emre nevayeshirazi
emre nevayeshirazi

Reputation: 19241

How to Ignore Daylight Savings

I am receiving some data from web service and one of the fields is the Data object.

For instance, 2014-06-30T07:45:00+02:00 is the DateTime value.

When I try to parse this and get the time via

var time = DateTime.Parse("2014-06-30T07:45:00+02:00").TimeOfDay;

I get 8:45:00 instead of 7:45:00

Is it possible to ignore the daylight savings ? since web service returning the correct Date anyway ?

Upvotes: 0

Views: 707

Answers (1)

Jurgen Camilleri
Jurgen Camilleri

Reputation: 3589

This should work:

var time = DateTimeOffset.Parse("2014-06-30T07:45:00+02:00").DateTime.TimeOfDay;

Upvotes: 4

Related Questions