sql epoch to php time()

Total brain fart..

What is the correct converson for sql to php time()?

This is needed,

WHERE (now()-15552000<datesubmitted)

datesubmitted is generated by time()

Thanks
LVL 10
rockmansatticAsked:
Who is Participating?
 
hernst42Commented:
If you are using mysql you can use

WHERE (now()-15552000<FROM_UNIXTIME(datesubmitted))

See http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html
0
 
rockmansatticAuthor Commented:
Thank you but that wont work exactly beacuse I need only the results from the past six months hence 15552000 seconds.

Although, I will look into converting it from there.

Rockman
0
 
rockmansatticAuthor Commented:
Thank you

just a little tweaking
to

WHERE DAYOFYEAR(now())-180 < DAYOFYEAR(FROM_UNIXTIME(datesubmitted))

Rockman
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.