Sorry...assumed ASP.Net.
Using VBScript with older ASP you would need to use the Year(), Day(), Month(), etc. functions to get the pieces of a Time variable.
Dim currentTime
currentTime = Now
Response.Write Year(currentTime) & "-" & Month(currenTime) & "-" & Day(currentTime) . . . etc.
Main Topics
Browse All Topics





by: tgerbertPosted on 2009-04-28 at 07:21:56ID: 24251095
Yes, check documentation for the .ToString method of the DateTime object.
("yyyy-MM- dd HH:mm:ss"));
("yyyy-MM- dd HH:mm:ss"))
DateTime dt = DateTime.Now;
Response.Write(dt.ToString
Dim dt As DateTime = DateTime.Now
Response.Write(dt.ToString