View Single Post
  #1 (permalink)  
Old 12-25-2007, 02:10 PM
penkomitev penkomitev is offline
Learning Programmer
 
Join Date: Dec 2007
Location: Plovdiv, Bulgaria
Age: 16
Posts: 30
Credits: 10
Rep Power: 4
penkomitev is on a distinguished road
Send a message via ICQ to penkomitev Send a message via Skype™ to penkomitev
Default A problem with NOW() - date_registered

Hello,
Merry Christmas first. A lot of health, hapiness and luck during the new year. Now to the question. I have written one script getting time from MySQL as seconds and the the value is being converted as years, months, days, hours, minutes, seconds. In my opinion, the script is working fine, but the MySQL engine itselfs is making troubles. I attached screenshots to view what exactly the problem is.

This is for the field.



A few results from the table


The query, calculating NOW() - date_registered. I added few additional information for you to have better orientation.

[SQL]SELECT username, NOW(), date_registered, NOW() - date_registered AS diff FROM users[/SQL]



In my calculations these are 4 hours 16 minutes and 25 seconds. This is 4*3600+16*60+25 = 15385 != 41625 -> for the first row
on the second screenshot.

I do not want to reinstall engine but first to hear your opinion.

Best regards,
Penko Mitev
Reply With Quote

Sponsored Links