Java action with java.util.date

0
Hi, I added a java action in mendix with the return type “Date and time”. Mendix generates a Java-Class for me with the method “executeAction” and the return type java.util.date. My method returns the UTC time, java.util.date has no information about the timezone, but the date and time, the method returns, is the in UTC time. But in my microflow, the return date and time is decreased by 1 hour by Mendix automatically. Mendix thinks that the java action returns a date and time in the local timezone (my local timezone is UTC+1h). But thats not true, my java action returns the UTC time. What I can do so that mendix uses the return date and time of my java action as UTC time and not as local time?
asked
2 answers
1

The microflow always differentiates between session time and utc time. In the debugger you can see both. Which one is off by an hour? Are you storing this date in an attribute of an entity? Is it set to localized or non localized?

answered
0

In my java action I select a timestamp from an entity of my database. This timestamp is UTC. 

In the debugger I can see that the utc and session time are equal, but not the timestamp my java action returns.

 

My java action returns 2021-02-10 06:35:36.152

In the debugger I can see this for the data and time my java action returns:

UTC time: 2021-02-10 05:35:36.152
Session time: 2021-02-10 05:35:36.152 +0000

answered