Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Forcing database datetime to UTC #128


User avatar
0
sameer created

Halil,

Thank you very much for putting together such an awesome solution. I have a little concern about using this framework for applications used in multiple timezones. How can I make sure that all the dates stored in the database are in UTC?

Regards.


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

    Hi,

    First,

    Set Clock.Provider = new UtcClockProvider(); (see <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp/Timing/UtcClockProvider.cs">https://github.com/aspnetboilerplate/as ... rovider.cs</a>)

    Then,

    Use Clock.Now everywhere instead of DateTime.Now. Abp also does it.

  • User Avatar
    0
    sameer created

    Thank! I shall give that a shot.