Thursday, June 14, 2007

ASP Date() And Time() Functions

OK, let's go. Remember, my server is in the UK. I will be using the method for writing the info to the page.


Returns the current date & time like this ....
6/5/2007 6:34:52 AM

--------------------------------------------------------------------------------


Returns the current date like this ....
6/5/2007

--------------------------------------------------------------------------------


Returns the current time like this ....
6:34:52 AM

--------------------------------------------------------------------------------


Returns the current year like this ....
2007

--------------------------------------------------------------------------------


Returns the current month like this ....
6

--------------------------------------------------------------------------------


Returns the current day like this ....
5

--------------------------------------------------------------------------------


Returns the current hour like this ....
6

--------------------------------------------------------------------------------


Returns the current minute like this ....
34

--------------------------------------------------------------------------------


Returns the current second like this ....
52

--------------------------------------------------------------------------------


Ok ..... You got the hang of that? We will now start jazzing things up a bit.


Returns the current date & time like this ....
6/5/2007 6:34:52 AM

--------------------------------------------------------------------------------


Returns the current date like this ....
Tuesday, June 05, 2007

--------------------------------------------------------------------------------


Returns the current date like this ....
6/5/2007

--------------------------------------------------------------------------------


Returns the current time like this ....
6:34:52 AM

--------------------------------------------------------------------------------


Returns the current time like this ....
06:34

--------------------------------------------------------------------------------


Returns the current month like this ....
June

--------------------------------------------------------------------------------


Returns the current month like this ....
Jun

--------------------------------------------------------------------------------


Returns the current day like this ....
3

--------------------------------------------------------------------------------


Returns the current day like this ....
Tuesday

--------------------------------------------------------------------------------


Returns the current day like this ....
Tue

--------------------------------------------------------------------------------


OK ... Let's take all this a little further


Returns what the date will be in 10 days time like this ....
6/15/2007 6:34:52 AM

--------------------------------------------------------------------------------


Returns what the date was 3 days ago like this ....
6/2/2007 6:34:52 AM

--------------------------------------------------------------------------------


Returns the number of days that have passed since the 24th of March 2002
1899

--------------------------------------------------------------------------------


Returns the date in typical UK format
5/6/2007

--------------------------------------------------------------------------------


Returns the date in typical USA format
6/5/2007

--------------------------------------------------------------------------------


Returns today's date like this ......
Tuesday, 5 June, 2007

No comments: