-
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Understanding "DefaultMARSJSONSerializationOptions.DateIsUTC" #118
Comments
Hi @ertankucukoglu , I have to say I am a bit unsure here. You can spot the time zone specified in the serialized string value (Z = UTC): // with DateIsUTC = True on my machine (that is on Rome time zone: +02:00 at the moment) // with DateIsUTC = False on my machine (that is on Rome time zone: +02:00 at the moment) In the first case (DateIsUTC = True) the value is actually converted to UTC (my clock was showing 12:13:49 because I am in Rome time zone +1 with another +1 of daylight saving). I have mixed feeling about the name "DateIsUTC". Is it misleading? Thank you, regards |
Probably one of the issues is that it is not so usual to have a machine with UTC time.
If your server is in UTC timezone (no offset with UTC), the value would be set to True. False otherwise (my local machine would be False then and I would have date time values serialized with explicit timezone offsets). |
DefaultMARSJSONSerializationOptions.DateIsUTC now gets initialized in the initialization section of MARS.Core.JSON unit.
Thank you for explanation. |
Hello,
By the meaning of subject variable, I understand that
TDateTime
values will be converted to UTC when it is set toTrue
. Such as2022-01-30T00:00:00.000Z
value from database where server is set to UTC+3 will be converted to2022-01-29T21:00:00.000Z
If that understanding is correct, I confirm that there is a bug and it works the other way around in the latest commit.
If that understanding is wrong, then give it to my misunderstanding and sorry for the noise.
Currently, when this variable is set to
True
values in json string are same as in database, when set toFalse
values are converted to UTC.I appreciate some clarification, please.
Thanks & Regards,
Ertan
The text was updated successfully, but these errors were encountered: