I am using following function and I want time in 24hr clock format but this gives me time in 12hrs:
<?php
date_default_timezone_set('Asia/Kolkata');
$timestamp = date("d/m/Y h:i:s", time());
print $timestamp ;
?>
What am I doing wrong?
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.
From the docs for
date(): TheHformat character gives the hour in 24h format. Also, you can useGif you do not want the leading0for hours before noon.Examples (if current time was seven-something-AM)
date('H:i:s')-> “07:22:13”date('G:i:s')-> “7:22:13”For your specific case: