Jump to content


Photo

date("Hi") returns wrong value.. php.net manual is wrong?


  • Please log in to reply
2 replies to this topic

#1 karthikeyan_coder

karthikeyan_coder
  • Members
  • PipPipPip
  • Advanced Member
  • 201 posts

Posted 30 October 2006 - 07:08 PM

i need current Hour and Minute in the format 00 to 23 and 00 to 59.. i searched in
http://in2.php.net/m...nction.date.php

H 24-hour format of an hour with leading zeros 00 through 23

i Minutes with leading zeros 00 to 59


i tried this
$k = date("Hi");
echo("$k");
output is...
190753

after each refresh it is just incrementing.. :(

I need current Hour and Minute in 00 to 23 hour format and 00 to 59 minutes format... any other way to get???

Thank you.

www.karthi.us

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 30 October 2006 - 07:15 PM

It looks like you are using "His" not "Hi" as the argument to the date() function. This works for me:
<?php
$k = date("Hi");
echo $k;
?>

Ken


#3 karthikeyan_coder

karthikeyan_coder
  • Members
  • PipPipPip
  • Advanced Member
  • 201 posts

Posted 30 October 2006 - 07:41 PM

ahh yes Kenrbnsn... it was my minor mistake...
www.karthi.us




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users