Jump to content


Photo

MySQL NOW()


  • Please log in to reply
3 replies to this topic

#1 johnnyk

johnnyk
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 22 June 2006 - 01:39 AM

Does NOW() in MySQL change according to daylight savings?
If it does, should I use ... INTERVAL + 5 + date(I)?

Also, what's the correct way to add an interval in MySQL?
Now() + INTERVAL 5
or
DATE_ADD(NOW(), INTERVAL 5 HOURS)
Rediscover the Web:
<a href="http://www.spreadfir...;t=219"></a><br />

#2 akitchin

akitchin
  • Staff Alumni
  • Advanced Member
  • 2,516 posts
  • LocationCalgary, AB, Canada

Posted 22 June 2006 - 01:46 AM

not sure about DST, but the correct syntax is:

DATE_ADD(NOW(), INTERVAL 5 HOUR)

the interval type needs to be singular, which has always tripped me up.

#3 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 22 June 2006 - 01:51 AM

This would depend upon the servers OS setting I would think.

#4 johnnyk

johnnyk
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 22 June 2006 - 04:44 PM

[!--quoteo(post=386692:date=Jun 21 2006, 09:51 PM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Jun 21 2006, 09:51 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
This would depend upon the servers OS setting I would think.
[/quote]
Is there a way to find out if my server uses DST on MySQL without waiting until the fall? My host outsources and asking them won't solve anything.
Rediscover the Web:
<a href="http://www.spreadfir...;t=219"></a><br />




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users