jliz2803 Posted May 26, 2006 Posted May 26, 2006 How would I go about converting a string to a date: I have this Dim Dat as DateTime Dat = Date.FromOADate(6/03/06) but this always returns 8:00:00AM how do I get it to return 6/03/06 as a date I am doing this because I want to be able to add one day onto this value, I also do not know how to do that. Any suggestions? Thanks Quote
jliz2803 Posted May 26, 2006 Author Posted May 26, 2006 I got it converted to Date with the Basic CDate conversion gosh I'm an idiot, does anyone know how to add 1 day to this value though? Quote
jliz2803 Posted May 26, 2006 Author Posted May 26, 2006 Nevermind I got it with the .AddDays(10) Thanks Quote
Diesel Posted May 26, 2006 Posted May 26, 2006 Oh my god. You realize that 6/03/06 is not a string. "6/03/06" is a string. Use DateTime.Parse Quote
Leaders snarfblam Posted May 26, 2006 Leaders Posted May 26, 2006 My goodness, gracious, great balls of fire. VB also has support for DataTime literals if that helps. Instead of quotes you can use number signs... Dim TheThirtyFirstOfMayInNineteenNinetyThree As DateTime = [color=Red]#5/31/1993#[/color] And just to point out... Posts should be posted in the proper forum[/Quote] A post like this, which really has nothing to do with ASP.NET should really go in the general section. Also, it would do you a lot of good to check the object browser, intellisense, MSDN, or do a quick google before posting here so that you don't find yourself answering your own questions this way on a public forum. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.