Problem with dates

0
Hi, I'm in mendix studio pro 10.9.0. I'm heaving some issues with the time and date attributes. Basically my program needs to send an image to a python script, that script needs to do some operations including reading the path that contains the timestamp of the image. Got that it transofrms that into a JSON formatted date string and sends it back to my mendix app. Even though the date that my script sends, what i receive is another date, with 2 hours further. I'm suspecting that it's due time zone issues or whatever.   If that helps here are some screenshots: here's how my python script gets the date into the JSON format   Here's what it prints out:   Here's the JSON structure:   Here's what mendix receives:   And here's the application result: Here the time after "orario" should be the timestamp in the photo   Thanks for the help and sorry for the eventual grammar mistakes
asked
2 answers
0

Hello, there is definitely some issue with time zones settings. They can be changed at app level or properties level.

Another fast solution is to parse your time with AddHours() function where you add a negative number.

Example:

AddHours($yourdate,-2)

answered
0

Hi Damiona,

 

Mendix internally uses UTC for storing and for communicating via integrations. For a given user, it may transform the time into the local timezone to display on a page, depending on the "localized" setting of a datetime attribute. https://docs.mendix.com/refguide/attributes/#localize

 

I am not a python expert, but does your python script parse the date assuming it is UTC or assuming it is in local time? There may be the issue.

 

I hope this helps.

Michiel

answered