Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: DATE_ADD MySQL Function?

Quote Reply
Re: DATE_ADD MySQL Function? In reply to
Hi,

Sorry, I don't mean to use a TIMESTAMP column type, but rather use an INT. Then to store the current time you just do:

my $now = time();
my $sql = 'INSERT INTO foo VALUES($now)';

To display it you can just use the localtime function.

my $display_time = localtime ($time);

or you can break it apart into whatever format you like. It's actually a lot less headaches if you want anything other then mysql yyyy-mm-dd format.

Cheers,

Alex

--
Gossamer Threads Inc.
Subject Author Views Date
Thread DATE_ADD MySQL Function? Stealth 5982 Jul 13, 2001, 9:06 PM
Thread Re: DATE_ADD MySQL Function?
Alex 5884 Jul 16, 2001, 11:54 AM
Thread Re: DATE_ADD MySQL Function?
Stealth 5876 Jul 16, 2001, 8:00 PM
Thread Re: DATE_ADD MySQL Function?
Alex 5877 Jul 16, 2001, 11:00 PM
Thread Re: DATE_ADD MySQL Function?
tom_lee 5870 Jul 17, 2001, 7:13 AM
Post Re: DATE_ADD MySQL Function?
Stealth 5849 Jul 17, 2001, 5:47 PM