Jeewhizz
07-08-2003, 01:54 AM
Registering dates and time : date, time, datetime, year and timestamps columns
A lot of people have problems with storing and displaying dates.
The best way to avoid these is by choosing the right column-type. For example, if you only need the date, then don't use a datetime column and spare yourself the hassle of extracting the date from the datetimevalue. You'll find a complete overview of all datetime-columntypes at http://www.mysql.com/doc/en/Date_and_time_types.html
For these stored date/datetime/timestamp - values, there are a lot of functions to convert or extract parts of the values and respond them in the format that you need them. You'll find a complete overview of these functions at http://www.mysql.com/doc/en/Date_and_time_functions.html
It's important to note that these are MySQL function, which can be used inside sql-statement that are processed by the MySQL server. All these functions can be used from the command-line, in embedded sql (query's inside ASP, PHP, JSP, ...) or database-front-ends.
Within each serverside language, there are some (or a lot) of
date/datetime/timestamp functions.
for PHP : http://www.php.net/datetime
for ASP : http://www.4guysfromrolla.com/webtech/110398-1.shtml (VBscript)
and
http://www.haneng.com/FunctionSearch.asp?s=a (for all VBscript
functions)
Create by: raf
A lot of people have problems with storing and displaying dates.
The best way to avoid these is by choosing the right column-type. For example, if you only need the date, then don't use a datetime column and spare yourself the hassle of extracting the date from the datetimevalue. You'll find a complete overview of all datetime-columntypes at http://www.mysql.com/doc/en/Date_and_time_types.html
For these stored date/datetime/timestamp - values, there are a lot of functions to convert or extract parts of the values and respond them in the format that you need them. You'll find a complete overview of these functions at http://www.mysql.com/doc/en/Date_and_time_functions.html
It's important to note that these are MySQL function, which can be used inside sql-statement that are processed by the MySQL server. All these functions can be used from the command-line, in embedded sql (query's inside ASP, PHP, JSP, ...) or database-front-ends.
Within each serverside language, there are some (or a lot) of
date/datetime/timestamp functions.
for PHP : http://www.php.net/datetime
for ASP : http://www.4guysfromrolla.com/webtech/110398-1.shtml (VBscript)
and
http://www.haneng.com/FunctionSearch.asp?s=a (for all VBscript
functions)
Create by: raf