Hi Everyone

I am trying to get the current time for a specific Timezone. This Timezone
may not be the same as the Timezone set in the phone.

Here is the code that I am using:

DateTime specTime = TimeZoneInfo.ConvertTime (DateTime.Now,
TimeZoneInfo.FindSystemTimeZoneById("Pacific/Auckland"));

This code works fine on my Mac running in ASP.Net but when I run it on
MonoTouch I get the following error:

System.ArgumentException: Kind propery of dateTime is Local but the
sourceTimeZone does not equal TimeZoneInfo.Local at
System.TimeZoneInfo.ConvertTime (DateTime dateTime, System.TimeZoneInfo
sourceTimeZone, System.TimeZoneInfo destinationTimeZone) [0x00018] in
/Developer/MonoTouch/Source/mono/mcs/class/System.Core/System/TimeZoneInfo.cs:179
at System.TimeZoneInfo.ConvertTime (DateTime dateTime, System.TimeZoneInfo
destinationTimeZone) [0x00000] in
/Developer/MonoTouch/Source/mono/mcs/class/System.Core/System/TimeZoneInfo.cs:173

Is this a bug in MonoTouch or should I be doing this a different way?

Thanks
Liam
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to