Open Closed

Date Time Issues #3006


User avatar
0
PSTEELNZ created
  • ABP Framework version: v5.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi, Having Date Issues between the Angular and C# Backend. Angular

  • Date is entered as 1999-07-03 using a Date Picker Component.
  • Angular Posts the date to API as 1999-07-02T00:00:00Z (As Im located in NZ GMT+12),
  • The value is stored in the Database as 1999-07-02 00:00:00.0000000.
  • When the call is made to the API the date is returned as 1999-07-02T00:00:00
  • Angular interprets it as being local browser time and displays it as 1999-07-02
  • Each time I Hit save the date decrements due to this.

How can I solve this issue?


1 Answer(s)
  • User Avatar
    0
    PSTEELNZ created

    Added context.Services.Configure<AbpClockOptions>(options => { options.Kind = DateTimeKind.Local; });

    All seems to be fine now.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09