I have this object:
public partial class TblThread
{
public int Id { get; set; }
public string? Guid { get; set; }
public int? FrameworkId { get; set; }
public string? Title { get; set; }
public string? Question { get; set; }
public string? Tags { get; set; }
public DateTimeOffset? DateCreated { get; set; }
public int? UserId { get; set; }
public virtual TblUser? User { get; set; }
}
The DateCreated field in the database has the datatype as DateTimeOffset(7) and default value is (getutcdate())
But when i do this and look at the value:
@thread.DateCreated
this value returns this:
"15/02/2025 07:07:37 +00:00"
But the value in the database is:
2025-02-15 07:07:37.2366667 +00:00
So how do i return the datetimeoffset from c# and get the localtime from the utc timestamp in new Date() in javascript?