When I send a datetime from the frontend through an AppService, it gets converted to UTC. But when I get a datetime value from a repository, it is not converted back to local time, even though I have the time zone set correctly in the settings.
According to this doc here: <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Timing">https://aspnetboilerplate.com/Pages/Documents/Timing</a> It should convert when reding from the database as well.
Is there something I am required to set up in Zero for this to work properly?
5 Answer(s)
-
0
Hi @BertusVanZyl ,
Which version/type(angular or mvc) of product are you using?
-
0
I am using angular 1, with MVC backend.
-
0
Hi @BertusVanZyl,
It is not converted to timezone when you get data from repository. If you are using UTC Clock Provider, you will get dates in UTC. You need to convert it to target timezone by yourself.
If there is no need on server side convertion, we suggest to send UTC dates to client end convert to user's timezone in client using moment.
-
0
Ok no problem. You guys might want to adjust the documentation here (<a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Timing">https://aspnetboilerplate.com/Pages/Documents/Timing</a>) a bit, it contains the following:
ABP automatically normalized DateTimes received from database based on the current clock provider, when EntityFramework or NHibernate modules used.
-
0
Hi @BertusVanZyl,
There is no timezone keyword in this sentence but you are right, it is a bit confusing even when I read it now :). We will try to make it better.