Base solution for your next web application
Open Closed

Why datetime filed automatically converted to Persian? #1499


User avatar
0
omital created

Hi, why all datetime fields in application service methods automatically converted to PersianDateTime and then return to client?


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

    Hi,

    Abp converts a datetime to local datetime if you use LocalClockProvider as Clock.Provider. I think this is probably the your case. Can you check the value of Clock.Provider ?

    You can use UtcClockProvider but in that case, all datetimes will be stored in UTC in database and will be sent to client in UTC.

  • User Avatar
    0
    omital created

    I checked it in one of the application service's method. It was {Abp.Timing.UnspecifiedClockProvider}. then I try to

    Clock.Provider = new UtcClockProvider();
    

    in PreInitialize method of WebModule, EntityFramework and Core module, but nothing happen.