Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: awibowoHi,
I am trying to create a timestamp from a string
for example:
input: 20100430
formula: timestamp(date('input', "CCYYMMDD")
expected result: 2010-04-30 00:00:00 (datetime type)
However, I got 2010-04-29 23:00:00
Oddly, if I used the example from the help menu
timestamp(date(2003, 3, 17)), I got 2003-03-17 00:00:00 as expected
If I changed the input to
timestamp(date(2003, 4, 17)), I got 2003-04-16 23:00:00
I tried with various days in March 2003, the results were as expected but as soon as I changed the year or month, it substracted 1 hour from the expected value. It seems like March 2003 is somewhat a "special" case
As temporary solution, I have the following
timestamp(date('Worked Date', "CCYYMMDD"), time('Job Start Time Actual',"HHMM")).dateTimeAdjust(1, "hours")
I have checked the results randomly, they seem to be correct, but I am not sure if any of them "incorrectly" add the 1-hour.
I am wondering if anyone has encountered the same issue?
Thanks
a.