I need to remove the seconds off of a returned time value. I get
12:00:00
I want
12:00pm
I tried using date() but it kept returning the time as 1:00am for everything.
echo date('g:ia', $timestamp);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
strtotime()–The
date()function –string date ( string $format [, int $timestamp = time() ] )– where$timestampis to be an integer Unix timestamp.