Creating a non-localized DateTime based on the Session Time of a localized DateTime

1
I have two time attributes. Attribute A is localized, attribute B is non-localized. If I just copy the value of A to B, it will copy the UTC time. What I want to do is, creating B based on the session Time of A. Let's say A is 12:00:00 UTC and 14:00:00 Session time (offset: +0200) I want to create B with 14:00:00 UTC and 16:00:00 Session time (offset: +0200) (Instead of 12:00:00 UTC and 14:00:00 Session time) I know that I could create a String with formatDateTime and parse it back to a DateTime with this command: parseDateTimeUTC(formatDateTime($Object/A, 'MM-dd-yyy HH:mm:ss'), 'MM-dd-yyy HH:mm:ss')  but I don't thnik that this is a best practice solution. Does anybody has a better Idea?
asked
1 answers
1

Hi Andreas,

I think the solution you proposed by formating and then parsing the date is straightforward and does not have any obvious drawbacks. 

-Andrej

answered