Base solution for your next web application
Open Closed

Correct way to use Abp.Timing #3237


User avatar
0
hussein created

Hi,

Right now i want to develop an application that support multi time zones, when i read documentation for timing here <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Timing#DocBindersAndConverters">https://aspnetboilerplate.com/Pages/Doc ... Converters</a>

i didn't find a way to set user time zone

so, let's say i set the provider to be UTC then all dates will be saved as UTC in the database, then i want to set the user time zone and get all dates from database according to user time zone

how can i do that ?

Thanks,


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

    Hi @Hussein,

    In AspNet Zero, we handle dates from database in UTC when using UtcClock provider and in client side we handle convertion from utc to user's timezone using moment-timezone library. In moment-timezone, you need to use IANA timezoneId for current user. ABP returns this to client under "abp.timing" javascript object.

    When changing user's timezone, you need to set setting named "Abp.Timing.TimeZone" for current user.

    I hope this helps.

    Thanks.