Interval Values for Dates & Times

When you work with dates and times, it is vital to know the correct value that represents the date or time period you are wanting. Here is a list of available date / time values:

Value – Meaning
“yyyy” – Year
“q” – Quarter
“m” – Month
“y” – Day of Year
“d” – Day
“w” – Weekday
“ww” – Week of Year
“h” – Hour
“n” – Minute
“s” – Seconds

Here is an example of how this may be used:

<% Response.Write DateAdd ("d", 1, Date) %>

This displays tomorrows date like this: 6/18/2015

For other examples, be sure to check out our Date scripts on our ASP Scripts page.

< Back to ASP Tutorials