
Timestamp UTC/GMT - formatted in english
I“m working on a log tool and have an issue. Is there a simple way to get a UTC timestamp to a field? Normally when I use ”Date Time“ I get my local date and time. In my case that is not usefull at all. I have tried to use this formule (from another post here) to get UTC (the hard way):
let response := http(”GET“, url(”http://api.timezonedb.com/v2.1/convert-time-zone?key=MyPrivateKey&format=json&from=Europe/Oslo&to=Europe/London&time=“ + format(”Local Date / Time“, ”X“)));
”Local Date / Time“ + number(response.result.offset) * 1000
This works but the result is published in norwegian, which is not usefull for people around the world. This timestamp (UTC) is also not on the print form, it”s an empty field. The “Local Date / Time” is on the form for printing, but is in my log it is not usefull to show.
Short: I need the UTC date and time and this result should be printable.
BTW! I use the MacOS App
-
Alain thanks for your input :-) The script ran but gave me one hour ahead of my local time (I know it needs tweaking). We use summer and winter time, so the difference between local and UTC time will not be constant. The script I already use takes this into consideration, but the time given by the formula (UTC) is not in the print form. I only have an empty UTC field there.
-
Thanks a lot for the inputs
These are the the results:
1: Local Date /Time (this is printable)
2: The script that collects UTC from the web (that I found here earlier and posted in the first post). Have not figured out how to print this result. It“s formatted in norwegian, have tried to edit the formatting but nothing has helped.
3: Alains first script, I made an error earlier so this works :-) But same as the other one, norwegian, cannot print the result.
4: Uwes script.Textfield; this shows norwegian time and UTC offset. This result is printable. Have not figured out how to just show UTC time and formatting like DD.MM.YYYY HH:mm
BTW! I”m new to Ninox, trying to learn, reading the manual and watching tutorials.