How to add a date variable and time variable together

0
Hi all,   I’ve got two variables one is [%BeginOfCurrentDay%] and the other is ‘Time’ which is specified by the user.   I need to add these two together somehow but I currently can’t remember how to do this.   Kind regards Nathan
asked
3 answers
0

Do note that in Mendix you always have a datetime attribute. So not only the date but also the time is stored in this single attribute.

See also the documentation here: https://docs.mendix.com/refguide/parse-and-format-date-function-calls#parsedatetime-utc

and here: https://docs.mendix.com/refguide/date-creation

Regards,

Ronald

 

answered
0

You want to show the beggining of the day that the user selected If I get what you're saying, correct?

 

If yes you can use “trimToDays($dateVariable)” this will set the hours and minutes to 0 and keep the selected date.

 

Documentation: https://docs.mendix.com/refguide/trim-to-date

answered
0

image.png

 

Just had this use case.  Here's the MPK of the NF in case anyone has the need in the future.

Parse_DateTime_AddTimeComponentToDateComponent

 

 

answered