[RESOLVED] [2005] DateTime
I am getting a datetime like this....
What format is this???
Code:
D:20080929130007+05'30'
When am trying to parse like below,error am getting
Code:
Dim dTemp As DateTime= DateTime.Parse(hTemp("CreationDate").ToString())
The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.
Re: [RESOLVED] [2005] DateTime
The +05 is the offset from GMT, but I don't know what the '30' is for.
vb.net Code:
Dim s As String = "D:20080929130007+05"
Dim d As Date = Date.ParseExact(s, "D:yyyyMMddHHmmsszz", Nothing)
MessageBox.Show(d.ToString(), "Local")
MessageBox.Show(d.ToUniversalTime.ToString(), "UTC")
Unless you're in the GMT+5 time zone then neither of the displayed values will be 1:00:07 PM on September 29, 2008. The second displayed value will be 5 hours before, i.e. 8:00:07 AM, which accounts for the +05 time zone offset. the first displayed value will depend on where you are. I'm in Sydney, Australia and we have daylight saving at the moment. That means our time zone is GMT+10 so I see 6:00:07 PM.