Set the time of a DateTime attribute

How do I change the time when I commit a DataTime Attribute? e.g. when I enter a date the platform stores 2009-12-31 05:00:00 and I want to change this before commit to 2009-12-31 12:00:00?
2 answers

Hi HP,

you could try:

addHours(trimToDays($object/Date1), 12)

From the old wiki (sorry, don't have a link here anywhere from the new documentation: Input: year, month, day, hour, minute, second
microflow expression:

dateTime(2007, 1, 1, 1, 1, 1)

output: "Mon Jan 01 01:01:01 CET 2007"

or, if you already have a date that you want to set the time of explicitly:

addMilliseconds(addMinutes(addHours(trimToDays($object/dateattribute), 3), 15), 50)

(which would trim it do the start of the day, then add 3 hours, then add 15 minutes and then add 50 milliseconds)