Base solution for your next web application
Open Closed

[Audit] CreationTime Datetime vs DatetimeOffset #512


User avatar
0
daws created

Hi there,

for ICreationAudited, it creates "CreationTime" with DateTime type.

Is there any plan to convert theses interfaces to DateTimeOffset ? since my app will be deployed on serveral timezones it could be good to manage time data from one database to another one.

note : maybe related <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/40">https://github.com/aspnetboilerplate/as ... /issues/40</a>


5 Answer(s)
  • User Avatar
    0
    ddnils created

    +1

  • User Avatar
    0
    byteplatz created

    +1 for DateTimeOffset

    for for the time being, maybe change the date to be stored in UTC (Always)

    Bruno

  • User Avatar
    0
    hikalkan created
    Support Team

    Hi @daws,

    Isn't UTC time works for you? What's advantage of DatetimeOffset?

    You can write

    Clock.Provider = new UtcClockProvider();
    

    on PreInitialize of your core module.

  • User Avatar
    0
    daws created

    To close this subjet; I abandonned the idea of datetimeoffset in my db.

    I converted every datetime in my db in UTC format and used the clock.provider like you said ("timing" in your doc).

    datetimeoffset could be good to be stored; but not in my case anymore.

    subject closed months after :mrgreen:

  • User Avatar
    0
    hikalkan created
    Support Team

    Thank you for writing your last message on that :)