We have observed a typical behavior, can someone let us know why this is happeni

We have observed a typical behavior, can someone let us know why this is happening:

SystemLocale set to EST New York. System Local is set to override user values which are set to No Preference.

Now check this expression: string(now()) --> this gives value of the current time in EST.
Now check this expression: todatetime(string(now())) --> this subtracts 5 hours from the current time to show earlier date time.

Can someone pl explain why such behavior is observed?...

OriginalPostID-102378

OriginalPostID-102378

  Discussion posts and replies are publicly visible

Parents
  • You can achieve your date format by using text(pv!dateVariable, "mm/dd/yyyy")

    I'm not sure why you are converting a date time to a string and back to a date time. A reminder regarding the use of todatetime() is tthe system assumes the timestamp defined in the string is GMT; therefore, when displaying the value it will be offset by your system time zone. This accounts for your five hour difference.

    If you must proceed with todatetime(string(now())), you can wrap that with gmt(). This will store the GMT value, but will be adjusted for display to match the time zone your system is set to.
Reply
  • You can achieve your date format by using text(pv!dateVariable, "mm/dd/yyyy")

    I'm not sure why you are converting a date time to a string and back to a date time. A reminder regarding the use of todatetime() is tthe system assumes the timestamp defined in the string is GMT; therefore, when displaying the value it will be offset by your system time zone. This accounts for your five hour difference.

    If you must proceed with todatetime(string(now())), you can wrap that with gmt(). This will store the GMT value, but will be adjusted for display to match the time zone your system is set to.
Children
No Data