FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » MySQL date time current time diffenece
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: MySQL date time current time diffenece [message #175205 is a reply to message #175188] Mon, 22 August 2011 12:06 Go to previous message
Jonathan Stein is currently offline  Jonathan Stein
Messages: 43
Registered: September 2010
Karma:
Member
Den 21-08-2011 15:42, j wrote:

> echo "$mysql_datetime_formatted - $date_now = $diff in seconds";

If my fast interpretation of your code is right, this is only true for
intervals less than a minute. If the difference is exactly one minute,
your result will say 100 seconds.

> Can I count on (more or less) the MySQL time/time zone to be the same as
> that PHP uses?

Is "more or less" good enough for you? Often yes, but sometimes not...

> More reliable or easier way?

Look at "TIMESTAMPDIFF()", "NOW()" and the other date and time functions
in MySQL and let the database do all the work for you. - Then you're
also sure all calculations are based on the same timezone.

Regards

Jonathan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Webhosting, Domain Name, Data Center Cyprus, Hosting Services
Next Topic: Roll SQL name value query into two-dimensional array
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 20:32:28 GMT 2024

Total time taken to generate the page: 0.04245 seconds