I want to create a new
offset = -5
string dt = "11082016";
DateTime date = DateTime.ParseExact(dt, "MMddyyyy",
DateTimeOffset dto = new DateTimeOffset(date, TimeSpan.FromHours(-5));
Is it possible to create directly a DateTimeOffset without passing by DateTime ?
No, that's not possible.
Of course it has some constructors that doesn't take
DateTime as a parameter directly like;
Int64 values are still generate a
Datetime internally for current instance
I want to create a new DateTimeOffset with offset = -5 from a string
If you could do that, you wouldn't need that string, don't you think?