getDate and "{x,dateformat,x}" error
Posted: 18 Aug 2019 23:51
I'm having some trouble to convert a date and time. It seems to either result in an error or the same variable is returned.
These two values are the original data examples. Dateformat doesn't work on them.
However, as I only need the time, I used regex to extract the time from the Regular format string.
So I tried manually typing the time.
And the result is still "22:00".
My next step is to create a formula to convert the time into the form I'd like (hh:mm a) but just want to reach out and see if there's a flaw with my approach.
Finally, I'd like to add that the date from getDate() will convert just fine.
Anyone else experiencing this same thing and how did you go about approaching it? Thank you for taking the... time.
These two values are the original data examples. Dateformat doesn't work on them.
Code: Select all
timeA="2019-08-19 06:00:00"; //Regular format
timeB="1566194400" //Epoch time
Code: Select all
timeC=findAll(timeA,'\\d{2}:\\d{2}');
timeD="{timeC,dateformat,hh:mm a}"
//timeD results in "22:00" which should not be correct based on the format options.
Code: Select all
time="{"22:00",dateformat,hh:mm a}"
My next step is to create a formula to convert the time into the form I'd like (hh:mm a) but just want to reach out and see if there's a flaw with my approach.
Finally, I'd like to add that the date from getDate() will convert just fine.
Anyone else experiencing this same thing and how did you go about approaching it? Thank you for taking the... time.