Pregunta

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 ?

¿Fue útil?

Solución

This should work:

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top