Skip to content

UnixDateTimeConverter Not Setting DateTime.Kind #772

@nariman-haghighi

Description

@nariman-haghighi

This should be set to Utc not Unspecified, causes all sorts of problems with serializers downstream. Using the following workaround at the moment:

    foreach (DateEntry e in hourlyLikes)
    {
    PropertyInfo f = typeof(DateEntry).GetProperty("Time", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

    if (null != f)
        f.SetValue(e, DateTime.SpecifyKind(e.Time, DateTimeKind.Utc));
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions