Outline ·
[ Standard ] ·
Linear+
ASP formatdatetime
|
nxfx
|
Mar 2 2006, 08:55 AM
|
|
One way is to seperate the datetime and rebuild it as string. If the date is like 03/02/2006 (MMDDYYYY) , break it to DD = 02 MM = 03 YYYY = 2006
From here you can just manipulate the string.
mydate = DD & "-" & MM & "-" & YYYY which looks like , 02-03-2006.
Just a suggestion anyway...
|
|
|
|
|
|
nxfx
|
Mar 2 2006, 02:52 PM
|
|
How about my method? I assume you want to save the datetime into your database, then how about formating it in the sql statement where the mysql has better formating option.
|
|
|
|
|
|
nxfx
|
Mar 2 2006, 03:34 PM
|
|
Emm, something like
mydate = "17/03/2004"
sql = "insert into Tbl(mydate) " sql = sql & " values(convert(datetime, ' " & mydate & "', 103))"
But this done using mssql, dunno if mysql have the same function.
|
|
|
|
|