|
-
Nov 22nd, 2008, 04:03 AM
#1
Thread Starter
Fanatic Member
[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.
Visual Studio.net 2010
If this post is useful, rate it

-
Nov 22nd, 2008, 04:54 AM
#2
-
Nov 22nd, 2008, 05:01 AM
#3
Thread Starter
Fanatic Member
Re: [2005] DateTime
From itextsharp..its a third party .net component for manipulating pdf.
am trying to get the cretion time of the pdf..
Visual Studio.net 2010
If this post is useful, rate it

-
Nov 22nd, 2008, 05:03 AM
#4
Re: [2005] DateTime
this D:20080929130007+05, looks like
2008 09 29 13:00:07 +05
sep 29 2008
-
Nov 22nd, 2008, 05:14 AM
#5
Thread Starter
Fanatic Member
Re: [2005] DateTime
 Originally Posted by dbasnett
this D:20080929130007+05, looks like
2008 09 29 13:00:07 +05
sep 29 2008
yes yes.. how you converted this..
i need the code..
Visual Studio.net 2010
If this post is useful, rate it

-
Nov 22nd, 2008, 05:19 AM
#6
Thread Starter
Fanatic Member
Re: [2005] DateTime
 Originally Posted by dbasnett
this D:20080929130007+05, looks like
wthether this an standard time format???
Visual Studio.net 2010
If this post is useful, rate it

-
Nov 22nd, 2008, 05:48 AM
#7
Re: [2005] DateTime
not any standard i know of
Code:
Dim tst As String = "D:20080929130007+05"
Dim newDT As DateTime
newDT = DateTime.Parse(tst.Substring(6, 2).PadRight(3, " "c) & _
tst.Substring(8, 2).PadRight(3, " "c) & _
tst.Substring(2, 4).PadRight(5, " "c) & _
tst.Substring(10, 2).PadRight(3, ":"c) & _
tst.Substring(12, 2).PadRight(3, ":"c) & _
tst.Substring(14, 2))
-
Nov 22nd, 2008, 06:12 AM
#8
Thread Starter
Fanatic Member
Re: [2005] DateTime
Well.. i too thought of this string manipulation only.,.
thanks a lot for finding the D:20080929130007+05 format...
Visual Studio.net 2010
If this post is useful, rate it

-
Nov 23rd, 2008, 09:38 PM
#9
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.
Last edited by jmcilhinney; Nov 23rd, 2008 at 09:41 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|