Skip to main content
March 14, 2022
Question

User language makes date format different when saves to DB

  • March 14, 2022
  • 1 reply
  • 0 views

Hi Guys, 

As the user's language can be set as English (US) and English (UK), and this will make the date format different when using the function now():

US format :   14/2022 6:36 AM GMT+00:00(Date and Time with Timezone)
UK format:    14/03/2022 06:36 GMT+00:00(Date and Time with Timezone)

and this will cause these two format's date save into DB (based on my current PM design) which will cause my following work flow (such as micro service retrives the date from DB) goes wrong when using these data.

I tried to transfer the date by using such method:

{
  todate(datetext(todate(now()), "DD/MM/YYYY"))
}

but it returns a unexpected value:

Date out of range (73032022)(Date with Timezone)

So I'm wondering if there is any method can resolve this issue, thanks

1 reply

stefanhelzle0001
Brainy
March 14, 2022

Appian datetime is strictly UTC internally. And that does not depend on your user timezone. As a datetime value is displayed to the user it is translated into the respective timezone. Appian will send the value to the DB in UTC as well. If you make sure that the DB is set to UTC, everything will just work.