The user profile page doesn't appear to allow the user to specify their timezone. How should we add this feature so the user can select and save their timezone and then have the web pages display the localised date?
Times are displaying in my browser according to the location of the server, so I edit a record at 7am local time, and it appears as if I edited it 4 hours in the future :)
Best solution for me is to allow the user to specify their timezone on their profile and then have this setting reflected in times displayed in the UI.
I'm set Clock.Provider to the UTC in file Startup.cs of ...Web.Host is OK
// using Abp.Timing;
public Startup(IHostingEnvironment env)
{
// Set Clock.Provider as UTC:
Clock.Provider = ClockProviders.Utc;
//_appConfiguration = env.GetAppConfiguration();
}
If Angular not sent date UTC you can using:
yourDate = abp.timing.convertToUserTimezone(yourDate); // to convert yourDate to date UTC.
You need to set the Clock.Provider to the UTC clock on the server. The documentation tells you that you need to set it but doesn't really tell you where. You just need to set this during the startup process. Here is a link to the docs that touch on it briefly.
Timing Documentation
Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With