Making it so timestamp variable gives UTC date & time instead of device-local time #565
-
|
Hello, I am trying to replicate TiddlyWiki's DateFormat in HTTP Shortcuts.
However, I need to shift the time to UTC+0 which is what TiddlyWiki stores its Is there a way to turn the timestamp into UTC time within HTTP Shortcuts please? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Currently, the Timestamp variable does not support this, but I will see that I can add support for this in the next version of the app. Until then, you can try this workaround:
const timestamp = (new Date()).toISOString().replaceAll(/[^0-9]/g, '');
setVariable("myTimestamp", timestamp);This will generate a timestamp in ISO string format (e.g. "2026-06-06T14:31:15.762Z"), strip all non-digit characters from it, and then assign the resulting value into the "myTimestamp" global variable. |
Beta Was this translation helpful? Give feedback.
Currently, the Timestamp variable does not support this, but I will see that I can add support for this in the next version of the app.
Until then, you can try this workaround:
This will generate a timestamp in ISO string format (e.g. "2026-06-06T14:31:15.762Z"), strip all non-digit characters from it, and then assign the resulting value into the "myTimestamp" glob…