Oct 10, 2005 #1 aspengal Technical User Dec 27, 2004 41 US I have a datetime variable and I want to pass the current date in this format to this datetime variable datetime variable = 12:24:36 00:12:33 How do i do that?
I have a datetime variable and I want to pass the current date in this format to this datetime variable datetime variable = 12:24:36 00:12:33 How do i do that?
Oct 10, 2005 #2 JurkMonkey Programmer Nov 23, 2004 1,731 CA datetime variable = DateTime.Parse("12:24:36 00:12:33"); It's either Parse() or ParseExact(). You may have to play with the string format a bit to make it work. Check this out: http://msdn.microsoft.com/library/d...f/html/frlrfsystemdatetimeclassparsetopic.asp Upvote 0 Downvote
datetime variable = DateTime.Parse("12:24:36 00:12:33"); It's either Parse() or ParseExact(). You may have to play with the string format a bit to make it work. Check this out: http://msdn.microsoft.com/library/d...f/html/frlrfsystemdatetimeclassparsetopic.asp
Oct 10, 2005 Thread starter #3 aspengal Technical User Dec 27, 2004 41 US Thanks JurkMonkey! Upvote 0 Downvote
Oct 11, 2005 1 #4 chiph Programmer Jun 9, 1999 9,878 US ParseExact is significantly faster, but is also much pickier about the formats that it accepts. Chip H. ____________________________________________________________________ Donate to Katrina relief: http://s1.amazon.com/paypage/PELYGQVJ8Q7IB/103-6821258-5919825If you want to get the best response to a question, please read FAQ222-2244 first Upvote 0 Downvote
ParseExact is significantly faster, but is also much pickier about the formats that it accepts. Chip H. ____________________________________________________________________ Donate to Katrina relief: http://s1.amazon.com/paypage/PELYGQVJ8Q7IB/103-6821258-5919825If you want to get the best response to a question, please read FAQ222-2244 first