03. april 2004 - 18:40Der er
11 kommentarer og 1 løsning
Noget ala timestamp, men med fast tid
hejsa,
Er det muligt at bruge noget andet end timestamp (integreret i mysql/phpadmin), så det kan anvendes som en signup dato? Som det er nu, opdaterer den tiden ved rettelser. Eller skal man til at bruge now() ?
DATE A date. The supported range is '1000-01-01' to '9999-12-31'. MySQL displays DATE values in 'YYYY-MM-DD' format, but allows you to assign values to DATE columns using either strings or numbers. See section 12.2.1 The DATETIME, DATE, and TIMESTAMP Types. DATETIME A date and time combination. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. MySQL displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format, but allows you to assign values to DATETIME columns using either strings or numbers. See section 12.2.1 The DATETIME, DATE, and TIMESTAMP Types. TIMESTAMP[(M)] A timestamp. The range is '1970-01-01 00:00:00' to sometime in the year 2037. A TIMESTAMP column is useful for recording the date and time of an INSERT or UPDATE operation. The first TIMESTAMP column in a table is automatically set to the date and time of the most recent operation if you don't assign it a value yourself. You can also set any TIMESTAMP column to the current date and time by assigning it a NULL value. See section 12.2 Date and Time Types. From MySQL 4.1 on, TIMESTAMP is returned as a string with the format 'YYYY-MM-DD HH:MM:SS'. If you want to obtain the value as a number, you should add +0 to the timestamp column. Different timestamp display widths are not supported. In MySQL 4.0 and earlier, TIMESTAMP values are displayed in YYYYMMDDHHMMSS, YYMMDDHHMMSS, YYYYMMDD, or YYMMDD format, depending on whether M is 14 (or missing), 12, 8, or 6, but allows you to assign values to TIMESTAMP columns using either strings or numbers. The M argument affects only how a TIMESTAMP column is displayed, not storage. its values always are stored using 4 bytes each. From version 4.0.12, the --new option can be used to make the server behave as in version 4.1. Note that TIMESTAMP(M) columns where M is 8 or 14 are reported to be numbers, whereas other TIMESTAMP(M) columns are reported to be strings. This is just to ensure that you can reliably dump and restore the table with these types! See section 12.2.1 The DATETIME, DATE, and TIMESTAMP Types. TIME A time. The range is '-838:59:59' to '838:59:59'. MySQL displays TIME values in 'HH:MM:SS' format, but allows you to assign values to TIME columns using either strings or numbers. See section 12.2.2 The TIME Type.
Jeg skal bruge begge ting, så det er fint med DATETIME :)
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.