Click to See Complete Forum and Search --> : getting at using the date:


deep-wood
04-26-2006, 10:50 PM
hi!

ive seen it done in snitz, and for me, it would be best for what im needing:

the date&time is done:

yyyymmddhhmmss

how can i get the server time of the year say? just the year? and the same with the month...and the days and hours etc

so i could go:

response.write date_y & "/" & date_m & "/" & date_d & "/"

thanks all

candelbc
04-26-2006, 11:33 PM
There's plenty of ways to do this.. Here is some ASP Date Functions that might help you:

http://www.w3schools.com/vbscript/vbscript_ref_functions.asp

Let me know if this doesn't help!

-Brad

Terrorke
04-27-2006, 02:08 AM
Try this :


date_Y = Year(date)
date_m = month(date)
date_d = day(date)

response.write date_y & "/" & date_m & "/" & date_d & "/"

deep-wood
04-27-2006, 08:32 AM
thanks guys! thats great! :D

just out of curiosity - ive tried somthing....

date_h = hour(time)
date_m = minute(time)
date_s = second(time)

it works great but the hour is in 24 hour format - is there a way to put this into 12 hour?

candelbc
04-27-2006, 08:33 AM
You may want to research the FormatDateTime function...

deep-wood
04-27-2006, 08:44 AM
ohhhh ok ive used that before. so id do formatdatetime on date_h ?

deep-wood
04-27-2006, 08:48 AM
ive just looked it up and used it - works great. thanks for all your help!