Re: Storing Date in mysql
| From: | Tim Van Wassenhove | Date: | Thu, 08 Jul 2004 20:36:05 +0000 |
| Subject: | Re: Storing Date in mysql | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-35156@lists.php.net to get a copy of this message | ||
In article <20040708104445.7d42c400@mgalepc.utilitran.com>, Michael Gale wrote:
> Hello,
>
> I need to store the date of record / entry in the mysql database, so I have the following
> table create statement:
>
token_date varchar(100) NOT NULL default '',
Why don't you use a date format that your database supports? If i'm not
mistaken: timestamp, date, datetime... With from_unix function you can
convert unix timestamps to mysql timestamps. And with date_format
function you can format the timestamp to whatever you like. And you get
some functions to calculatie differences between timestamps etc...
--
Tim Van Wassenhove <http://home.mysth.be/~timvw>