You should format the date using the ISO unseparated date format, which is YYYYMMDD. Do not use any separator for the year, month, or day. Like this....
Insert Into SomeTable(DateColumn) Values('20090128')
Or
Update SomeTable Set DateColumn = '20090128' Where Id = 1
If you have a time included with your date, then the format should be: YYYYMMDD hh:mm:ss
Ex: '20090128 5:05 PM'
If you use this format, you will never have a problem.
Wednesday, January 28, 2009
Subscribe to:
Post Comments (Atom)
System.DateTime.Now.ToString("yyyyMMdd"))
ReplyDeleteDim myDate As DateTime = DateTime.Now
myDate = Convert.ToDateTime("12/10/2007")
myDate.ToString("yyyyMMdd"))