0

I am trying to convert a unix time stam in php but I am getting errors. I've done lots of research but non works. I keep on getting output 12/31/1969

time stamp from sql = 1396483200

my php is

$q=mysql_query("SELECT * FROM schedule WHERE ID='$id' LIMIT 1");
$q=mysql_fetch_array($q);
$a_sdate=$q['SCHEDULE_DATE'];
$a_sdate=date("m/d/Y", strtotime($a_sdate));

can anyone tell me what I am doing wrong?

1 Answer 1

1

If you already got the unix timestamp from the database, then you don't need to use strtotime:

$a_sdate=date('m/d/Y', $a_sdate);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.