UTC and Local Datetime

0
so i have microflow that used in rest services.   i want to compare a datetime that saved in database and currentdatetime. the problem is when i compare it, the date that datetime comparing is on UTC : UTC time: 2024-02-29 17:00:00.000Session time: 2024-02-29 17:00:00.000 +0000   but value of currentdatetime is : UTC time: 2024-03-01 00:00:00.000Session time: 2024-03-01 00:00:00.000 +0000   the question is how to make either datetime of database into local version or the currentdatetime into UTC version 
asked
6 answers
3

You might want to read this FAQ: https://docs.mendix.com/refguide/datetime-handling-faq/

Dates are always stored in the database in UTC. For an attribute you have the option to set localize to yes. The date is then still stored in UTC only when viewing the value Mendix will change it to the timezone of the user viewing the value.

Regards,

Ronald

 

answered
0

Hi Yohanes,

 

I understand the issue here.

 

As today date is 2024-03-04, so as per condition it should return the second record.

 

It is returning the right record.

 

correct me if I'm wrong.

answered
0

image.png

thanks for the reply Bhargav Ram Singh Bondili,

 

so this is the attributes of the entity, and yes i localize the attribute.

the fun fact is if i use the same condition for mendix page, i get the result that i want.

but, if its for the rest services, i get result like i said before

answered
0

image.png

 

 

I tried with the same attributes and condition, it worked well.

 

Please refer screenshot for the microflow.

 

correct me if I'm wrong.

answered
0

image.png

This is the microflow.

 

the list in on VersioningList and the condition that i struggle with is on VersioningActive. 

and yeah, i too have same way on another microflow that used for mendix page and its works fine

 

but when is used it for REST Services, i got this problem.

so i think the problem is only when i using it for REST Services

answered
0

image.png

 

I also tried with Rest API, Swagger page is retrieving the same result as desired.

answered