Any idea why different dates? I know it is related...
# suitescript
f
Any idea why different dates? I know it is related to timezone, but should it not be the same? since both don't have a specified time zone
c
This is not the answer to your question but both your dates specify Zulu (UTC) as the timezone
Could you paste your code here? It'd be easier to play with
f
That was intentional, this is the result of .toISOString() in JavaScript
I don't have this sample code saved anymore 😞
j
I believe formatting a DATE will convert to the user preference or system preference time zone. At 4am if your time zone is the previous day, that’s why that is showing one day earlier.
But my head always hurts when I try to figure this out. My explanation doesn’t seem to fit with your logged results. For reference though, what is the time zone set to for your user during that session?
(It looks like UTC-0300?)
Maybe DATE and DATETIME are inconsistent? Like maybe DATE uses the account level time zone or the server level time zone, but DATETIME uses a user configured time zone?
r
Try format.Type.DATETIMETZ
f
It was UTC-0300, DATETIMETZ work the same as DATETIME for me as well, only DATE generate that odd result