Skip to content

error converting to datetimeoffset #1

@urrpurr

Description

@urrpurr

Hi,

I kept getting errors while trying to run "2fa.exe list".
The error was happening in DateTimeOffsetJsonConverter.cs file.
I divided by 1000 (assuming it was in milliseconds instead of seconds and got it to work for me)

public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
    long milliseconds = reader.GetInt64();
    long seconds = milliseconds / 1000;
    return DateTimeOffset.FromUnixTimeSeconds(seconds);
}

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions