|
-
Dec 13th, 2009, 07:33 PM
#1
Thread Starter
Lively Member
Re: Date format
Thanks Jmcilhinney
Here how I'm using my date. I use this code to acquire the date and format it.
[CODE] Public m_Today As String = FormatDateTime(Now, DateFormat.GeneralDate)/CODE]
And then I convert it to date as follows.
Code:
Dim todaydate As Date = CDate(RogersForm.m_Today)
-
Dec 13th, 2009, 08:43 PM
#2
Re: Date format
 Originally Posted by viper5646
[CODE] Public m_Today As String = FormatDateTime(Now, DateFormat.GeneralDate)/CODE]
Code:
Dim todaydate As Date = CDate(RogersForm.m_Today)
Perhaps you could refrain from putting your actual comments inside QUOTE tags. QUOTES are for quoting other posts, not your own.
As for the issue, there is absolutely no point, under any circumstances, in converting a Date to a String and back to a Date. Like I said, Dates are binary objects that have no format so you can't possible gain anything by that and you might end up losing data or causing an error. If you want today's date then use today's date:
Code:
Dim todaysDate As Date = Date.Today
You then need to insert that value into the database as a binary date, NOT as text. You haven't actually provided us with the code that you use to insert the data into the database as I requested.
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
|