Hi
20101130140000.0Z == 12/1/2010
20101207135959.0Z == 12/7/2010
20101206140000.0Z == 12/7/2010
20101208135959.0Z == 12/8/2010
20101116140000.0Z == 11/17/2010
20101125135959.0Z == 11/25/2010
20101104140000.0Z == 11/5/2010
20101213135959.0Z == 12/13/2010
20101102140000.0Z == 11/3/2010
20101209135959.0Z == 12/9/2010
20101123140000.0Z == 11/24/2010
20101125135959.0Z == 11/25/2010
20101126140000.0Z == 11/27/2010
20101130135959.0Z == 11/30/2010
20101001140000.0Z == 10/2/2010
20101005135959.0Z == 10/5/2010
Values on the left are obtained from Active Directory and the dates at the right are obtained using Exchange Powershell
Note: i need to know how to convert the values on the left to dates at the right using .NET 2.0 framework (VS 2005) in either C# or VB.NET
Thanks
Jacks
Loading
Sam HobbsPosted Dec 10, 2010, 9:13 PM
I suggest converting the UTC time values to a DateTime object then use a DateTime method or property top convert the time to a string representation of the local time. That should be accurate as well as easy.
Suthish NairPosted Dec 10, 2010, 3:00 PM
string timeUtc = "20101005135959.0Z".Replace(".0Z", "");DateTime dt = DateTime.ParseExact(timeUtc, "yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture);
String sdt1 = String.Format("{0:MM/dd/yyyy}", dt);
String sdt = Convert.ToDateTime(dt).ToString("MM/dd/yyyy").Replace(".", "/");
Am not sure about above code, you give a try..
Also refer converter: http://www.worldtimeserver.com/convert_time_in_UTC.aspx
Madhu KPosted Dec 10, 2010, 4:27 AM
Jacks WacksPosted Dec 10, 2010, 4:18 AM
That's a simple answer to a complicated question
If you look closely at the values on the left and right they do not match
I think 4,2,2 and the remaining values may be a timestamp but the .0Z is a bit confusing
for example
2010-12-06 140000.0Z == 12/7/2010 This is the 3rd line above
Madhu KPosted Dec 10, 2010, 3:48 AM
if the length of string is always same then you can use below
string a = "20101005135959.0Z";
string sub = a.Substring(4, 2) + "/" + a.Substring(6, 2) + "/" + a.Substring(0, 4);