Is there a DateTime like object in .NET that handles UTC also? That is, the
object contains the timezone and can properly compare between them.
Or how does one go about handling them if not? My info is
date/time/UTC(like, say +2:00 (EST)) and I want to do the least amount of
work to use those absolute times and compare between them. As far as I can
tell, DateTime doesn't work with UTC extension and I can't seem to find any
other class that will.
Thanks,
Jon
Jeroen Mostert - 19 Mar 2008 22:19 GMT
> Is there a DateTime like object in .NET that handles UTC also? That is, the
> object contains the timezone and can properly compare between them.
[quoted text clipped - 4 lines]
> tell, DateTime doesn't work with UTC extension and I can't seem to find any
> other class that will.
DateTimeOffset.

Signature
J.
Jon Slaughter - 20 Mar 2008 00:43 GMT
>> Is there a DateTime like object in .NET that handles UTC also? That is,
>> the object contains the timezone and can properly compare between them.
[quoted text clipped - 6 lines]
>>
> DateTimeOffset.
thanks, looks like what I'm after.
BlackWasp - 19 Mar 2008 23:27 GMT
Hi Jon,
the DateTime structure does handle UTC to some degree and provides methods
for converting between UTC and local dates. Check out my articles on the
DateTime structure and how to format it for some details.
C# DateTime Data Type -
http://www.blackwasp.co.uk/CSharpDateTimeDataType.aspx
C# DateTime Manipulation -
http://www.blackwasp.co.uk/CSharpDateManipulation.aspx

Signature
BlackWasp
www.blackwasp.co.uk
> Is there a DateTime like object in .NET that handles UTC also? That is,
> the object contains the timezone and can properly compare between them.
[quoted text clipped - 7 lines]
> Thanks,
> Jon