Write localized time instead of UTC

0
Is there a way to write the local time without calculating the offset and subtracting it from the UTC time that is written when I use [%CurrentDateTime%]. I am writing [%CurrentDateTime%] time to DB and it only seem to write in UTC
asked
2 answers
1

Joseph,

The platform always stores date time values in the database in UTC.  Documentation describing date time handling can be found here:  https://docs.mendix.com/refguide/date-and-time-handling

If you describe what you're trying to accomplish, the community will probably have some ideas to help you.  I am pretty sure most Mendix developers have wrestled with complex date time handling at one time or another, I know I have!

Mike

answered
0

What do you want to achieve? Date/time variables that are localized are displayed in the timezone of the user. You may use https://docs.mendix.com/refguide/parse-and-format-date-function-calls#formatdatetime-utc to format a date into a string. These pattern values will help you format the value: https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

answered