Open Closed

I want to set Current Time zone Setting to user. But here missing time zone dropdown #9682


User avatar
0
Hon-Tre_IFS created

I want to read the time zone of the user from setting in abp. where can i get those setting or configure those setting to the user so that i can use it to convert UTC to user local time


2 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent

    To enable and configure the user time zone setting in ABP, you need to use the Abp.Timing.TimeZone setting, which can be set per user, tenant, or globally. By default, the time zone dropdown is not shown on the user profile page unless you enable and configure this feature.

    Here's how you can enable and use the user time zone setting:

    1. Enable Time Zone Setting:
      • Make sure your solution is using ABP version 7.4 or later, as the time zone setting feature is available from this version.
      • In your module configuration, set the clock kind to UTC:
    Configure<AbpClockOptions>(options =>
         {
             options.Kind = DateTimeKind.Utc;
         });
    
    1. Show Time Zone Dropdown in UI:

      • The time zone dropdown is available in the Account Pro module. If you are using the open-source edition, you may need to implement your own dropdown or upgrade to the commercial version.
      • For the commercial Account Pro module, users can set their own time zone in the account settings page, and the setting will be stored as Abp.Timing.TimeZone.
    2. Read the User's Time Zone Setting:

      • You can read the user's time zone setting using the setting provider:
    var userTimeZone = await SettingProvider.GetOrNullAsync(TimingSettingNames.TimeZone);
    
    • Use the IClock service to convert between UTC and the user's local time:
    var userTime = Clock.ConvertToUserTime(utcDateTime);
    
    1. Documentation and References:
      • For more details, see the official documentation and a full example:
        • https://abp.io/docs/latest/framework/infrastructure/timing
        • https://abp.io/community/articles/zk7fnrdq

    If you do not see the time zone dropdown, ensure you have enabled the feature in your settings and are using the correct ABP modules. For open-source, you may need to add a custom dropdown and save the setting using the ABP setting system.

    Sources:

    • https://abp.io/docs/latest/framework/infrastructure/timing
    • https://abp.io/community/articles/zk7fnrdq

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You need to set the Kind to UTC first

    Configure<AbpClockOptions>(options =>
    {
     options.Kind = DateTimeKind.Utc;
    });
    

    See https://abp.io/docs/latest/framework/infrastructure/timing#clock-options

Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 16, 2025, 10:35