Base solution for your next web application
Open Closed

Datetime issue #1569


User avatar
0
loremerca created

Hi, I use the last version of abp with module zero and I have this problem. When I try to send datetime from angular app to server the date start like Utc time and when arrive to db doesn't convert and it's store less gmt time. so when I retreve date I lost two hours (+0200) my local time. When I used the 9.0 version I didn't have this problem. When I see creationTime that it's automatically compiled by server the data store is with 2 hour add and it's ok. Please help me. Thanks in advance.


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Which Clock provider do you use ? You can find it in ApplicationStart of Global.asax.

    There are 3 clock providers in Abp, UtcClockProvider, LocalClockProvider and UnspecifiedClockProvider. You should probably use LocalClockProvider.

  • User Avatar
    0
    loremerca created

    Hi in my application_start clock it's not set, in abp.js is unspecifiedClockProvider. I take default configuration.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    It was LocalClockProvider before but changed in release 0.9.7.0 <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/releases/tag/v0.9.7.0">https://github.com/aspnetboilerplate/as ... g/v0.9.7.0</a> with issue #1161 which is a breaking change.

    You can set it to LocalClockProvider like

    Clock.Provider = new LocalClockProvider();
    

    in the first line of Application_Start method of your Global.asax.

  • User Avatar
    0
    loremerca created

    But very very very very Thanks!!!!!! I'llgive you a beer!!! It's a promise, come here in Italy, 100km nord to heartquake! Today we dance...