Re: mktime() into TIMESTAMP ?
| From: | Erik Price | Date: | Tue, 05 Mar 2002 15:11:49 +0000 |
| Subject: | Re: mktime() into TIMESTAMP ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-87273@lists.php.net to get a copy of this message | ||
On Monday, March 4, 2002, at 07:22 PM, DL Neil wrote:
The choice comes down to how you are generating the time data prior to its storage in the db, and how you plan to use it afterwards. If you are going to be doing lots of temporal processing in PHP, then UNIX timestamp is the way to go. If it is purely a 'label' then stick with that format - even storing a string in MySQL that it doesn't realise is a date! Both PHP and MySQL have a wide range of time/date functions to support such activities.Thanks David, I think I'm going to avoid potential problems with TIMESTAMP columns' unique features by just storing a PHP mktime() value into a VARCHAR(15) column (advice from someone on this list, I can't remember who). While it will mostly be a label, and I could take a shortcut, the advantage is that I can always reformat the Unix timestamp (mktime()) for that later, and I plan to do searches based on date at times. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com