Software Sue

Link to Simply Sue
Link to Sustainability Sue
location: software/scripting/asp/dates Skip navigation : Home  

Functions in ASP for dates


Note that the date and time returned by ASP are those at the server end.

Also note that this site is hosted at a server which does not support ASP so all the examples here are either simulated using JavaScript or hardcoded with the date and time fixed. :-(

Under construction. The following is still all Javascript

Getting the Date and Time

Javascript provides a variety of functions for getting the date and time using both universal and local time.

Time Function Result Comment
Local getFullYear()  
Local getYear() Deprecated in javascript 1.2
Local getMonth() Starts with 0 for January.
Local getDay() Starts with 0 for Sunday.
Local getHours() 24 hour clock.
Local getMinutes()  
Local getSeconds()  
Local getMilliseconds()  
Local getTime() In milliseconds.
Local getTimezoneOffset() from GMT
Local toLocaleString() Local date as a string
Universal getUTCFullYear()  
Universal getUTCMonth() Starts with 0 for January
Universal getUTCDate() Day of the month
Universal getUTCDay() Starts with 0 for Sunday.
Universal getUTCHours()  
Universal getUTCMinutes()  
Universal getUTCSeconds()  
Universal getUTCMilliseconds()  
General toUTCString() UTC date as a string.
General toGMTString() Depracated in javascript 1.2.
General toString() Converts a date to a string.
General valueOf() Converts a date to a number.

Setting the Date and Time

Javascript provides a variety of functions for setting the date and time.

To be continued.