Open Closed

Application wide Datetime format and conversion #6801


User avatar
0
sukhdeep.dhillon created
  • ABP Framework version: v7.2.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)

Hi,

in ABP, is there any specific way to implement the following:

  1. How to convert application wide datetime from UTC to EST
  2. Format datetime for all API responses
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

4 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    You can try:

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

    Then you can set the time zone in the settings page

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Format datetime for all API responses

    can you elaborate

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    sukhdeep.dhillon created

    thanks you for your response if return Dto has property of type DateTime then it should follow some kind of format like yyyy-MM-dd like that

    how can I set any kind of specific format for all DateTime type

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    You can configure the AbpJsonOptions

    https://docs.abp.io/en/abp/latest/JSON#abpjsonoptions

    services.Configure<AbpJsonOptions>(options =>
    {
        options.OutputDateTimeFormat = "yyyy-MM-dd";
    });
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 23, 2026, 09:57
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.