Jump to content


Photo

code help


  • Please log in to reply
4 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 19 April 2006 - 02:53 AM

<?php
print time();
$foo = time();
print $foo;
?>
umm why did this give me
11454150731145415073
that updates every time I hit refresh, is there a better way to do this, htis may be the time, but I don't understand this language of time, I am use to 10:30, 12:20 or so so, military time, gmt +- theories, What is this number here for that autoupdated everytime I hit the refresh button.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 19 April 2006 - 02:58 AM

$mytime=time(hms);
echo $mytime;

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 19 April 2006 - 03:05 AM

Then I get the output of
1145415854
this is confusing. In javascript you just throw down a few variables ina function, and you can get the time, is it better doing this with javascript. Or is it really complicated with php.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 neylitalo

neylitalo
  • Staff Alumni
  • Advanced Member
  • 1,854 posts
  • LocationMichigan, USA

Posted 19 April 2006 - 03:10 AM

That's the current Unix timestamp. You want to use the date() function to format the date like this:

<?php

$timestamp = time();
$formatted = date("g:h:i", $timestamp);
echo $formatted;

?>

http://nealylitalo.net - My personal website, and home of The Netizen's Journal.

#5 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 19 April 2006 - 03:13 AM

thank you.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users