[PHP] Date time simplicity gotten out of hand
Hey, I thought this would be simple and just a few mins of programming but along the way...i have managed to confuse myself ;-D I have 2 field in my table users_online: present_date_time datetime expires_in datetime for present_date_time I am using now() to insert but for expires_in I need to have it now()+5 mins I was screwing around with now()+ X but thats getting me some weird results if its the end of the hour or day... Please help. Thanks, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.5 - Release Date: 4/7/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date time simplicity gotten out of hand
On Apr 9, 2005 12:35 PM, Ryan A [EMAIL PROTECTED] wrote: Hey, I thought this would be simple and just a few mins of programming but along the way...i have managed to confuse myself ;-D I have 2 field in my table users_online: present_date_time datetime expires_in datetime for present_date_time I am using now() to insert but for expires_in I need to have it now()+5 mins I was screwing around with now()+ X but thats getting me some weird results if its the end of the hour or day... mysql select NOW(), DATE_ADD( NOW(), INTERVAL 5 MINUTE ); +-+--+ | NOW() | DATE_ADD( NOW(), INTERVAL 5 MINUTE ) | +-+--+ | 2005-04-09 12:27:36 | 2005-04-09 12:32:36 | +-+--+ 1 row in set (0.00 sec) -- Greg Donald Zend Certified Engineer http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date time simplicity gotten out of hand
On 4/9/2005 7:28:34 PM, Greg Donald ([EMAIL PROTECTED]) wrote: On Apr 9, 2005 12:35 PM, Ryan A [EMAIL PROTECTED] wrote: Hey, I thought this would be simple and just a few mins of programming but along the way...i have managed to confuse myself ;-D I have 2 field in my table users_online: present_date_time datetime expires_in datetime for present_date_time I am using now() to insert but for expires_in I need to have it now()+5 mins I was screwing around with now()+ X but thats getting me some weird results if its the end of the hour or day... mysql select NOW(), DATE_ADD( NOW(), INTERVAL 5 MINUTE ); +-+--+ | NOW() | DATE_ADD( NOW(), INTERVAL 5 MINUTE ) | +-+--+ | 2005-04-09 12:27:36 | 2005-04-09 12:32:36 | +-+--+ 1 row in set (0.00 sec) F**K! If every you see me on the roadjust give a kick. WTF was I thinkingI went all around the monkeys butt trying to do this in another way instead of simple SQL. Thanks dude, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.5 - Release Date: 4/7/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php