?
Solved

sql epoch to php time()

Posted on 2004-09-08
3
Medium Priority
?
539 Views
Last Modified: 2008-02-26
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
0
Comment
Question by:rockmansattic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 1000 total points
ID: 12010044
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
 
LVL 10

Author Comment

by:rockmansattic
ID: 12011281
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
 
LVL 10

Author Comment

by:rockmansattic
ID: 12011313
Thank you

just a little tweaking
to

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

Rockman
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question