Hi all,
I would like to find a way to get the current UTC date in AL. I've been messing around with DateTime and similar, but it seems like it takes the user agent time zone in to account (which is out of our control), and it all just becomes a big mess with DateTimes not making any sense.
So, I need a way to get current UTC time, it is not an option to do a get request to external services, neither tampering with client computer time zones (spread around the world). All servers have their timezone set to UTC, so maybe I could fetch it from there in some way?
Suggestions appreciated, seems like a super simple task, but for some reason I'm not getting it to work.
0
Answers
This is the link:
https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-get-started-call-dotnet-from-al
And you can use this
The fuction Format(DateTime, 0, 9) give you an string with the date and time in UTC
Full code below, for other (not related to this) reasons, I had to convert it to a BigInt: