Skip to content

Datetime parsed to localTime. #153

@Sarogatip

Description

@Sarogatip

While passing DateTime object to DataTablesResult.Create method it is parsed to UTC time zone. In order to change it I had to include your whole project to my solution just to change:

static StringTransformers()
{
     RegisterFilter<DateTimeOffset>(dateTimeOffset => dateTimeOffset.ToLocalTime().ToString("g"));
     RegisterFilter<DateTime>(dateTime => dateTime.ToLocalTime().ToString("g"));
}

to:

static StringTransformers()
{
     RegisterFilter<DateTimeOffset>(dateTimeOffset => dateTimeOffset.ToString("g"));
     RegisterFilter<DateTime>(dateTime => dateTime.ToString("g"));
}

Is there any better way to do that? I'd like to display exactly this date which is stored in my database.
Thanks for any tips.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions