Dealing with timezones... Just flip-flopped betwee...
# suitescript
d
Dealing with timezones... Just flip-flopped between a pure-JS solution, then Luxon (moment.js successor), then format.format()... Only to find out that
format.format()
returns a 12 HOUR timestamp 😣 /rant but also if someone knows how to get
format.format()
to return in 24 hour format (or better yet, specify the format mask
yyyy-mm-ddThh:MM:ss
).
In the meantime I'm going back to Luxon....
j
I’m pretty sure format.format returns the date as a String in whatever default date formatting your NS account uses. Maybe
moment.js
will have something you can use if changing your default format is not an option?
d
ahhh, that makes sense that it uses the company preferences format (server script). Thank you! Checked and the company/general preferences match the string output (
D/M/YYYY
and
hh:mm AM/PM
) and yeah, time to go back to moment.js/luxon.js
b
usually you want moment timezone
luxon requires Intl related features to work outside of the pacific timezone of your server