Skip to content

Request for DateTime extension method to produce DateTimeOffset #1192

@gregveres

Description

@gregveres

Description

I really like the fluent way of creating a DateTime. But I use DateTimeOffset all over my code to better handle timezones. There doesn't seem to be a fluent way to create a DateTimeOffset.

The best I have come up with is:

new DateTimeOffset(1.November(2019).As(10,0), TimeSpan.FromHours(-5));
It would be really nice if there was an extension that added the timezone offset to a DateTime that resulted in a DateTimeOffset.

Something like:

1.November(2019).As(10, 0).WithOffset(-5)

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions