Jump to content


Photo

what kind of date is this?


  • Please log in to reply
5 replies to this topic

#1 MrLarkins.com

MrLarkins.com
  • Members
  • PipPip
  • Member
  • 20 posts

Posted 13 October 2006 - 08:21 PM

I pulled a date from mysql and this is what i get "1072806465"

what kind of formatting is that?  and how to i make it like 3-January 2003  or whatever the actual date is?

#2 lead2gold

lead2gold
  • Members
  • PipPipPip
  • Advanced Member
  • 164 posts
  • LocationOttawa, On

Posted 13 October 2006 - 08:22 PM

probably unix time.. it's the amount of seconds between now and Jan-1980.

You could try formating the time of your choice using mktime()



#3 kenrbnsn

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

Posted 13 October 2006 - 08:28 PM

You can also use the date() function.
<?php
$date = "1072806465";
echo date('j-F Y',$date);
?>


#4 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 13 October 2006 - 09:37 PM

probably unix time.. it's the amount of seconds between now and Jan-1980.


just to correct on this point, a timestamp like this is the number of seconds passed since 12:00:00am, 1st Jan 1970.
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#5 hanlonj

hanlonj
  • Members
  • PipPipPip
  • Advanced Member
  • 38 posts

Posted 13 October 2006 - 10:07 PM

And just to further add to this, that date (1st Jan 1970)is known as the "Unix Epoch"

HJ

#6 redarrow

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

Posted 14 October 2006 - 04:32 AM

A lttle help for you.


<?php

// Time is already a time stamp so echoing time you get the timestamp information.

$today=time();

echo "This is a timestamp from time $today";

// This is a timestamp from time but in human readable format.

$result2=date("d-m-y",$today);

echo " <br> This is a readable timestamp from time $result2";

// This is a date in a timestamp but in the date example you goto use the strtotime
//to convert the date to a timestamp.

$date_now=date("d-m-y");

$result_date=strtotime($date_now);

echo "<br> This is a date converted to a timestamp $result_date";

// This is date coverted from the timestamp from the $date-now in human readable conversion.

$date=date("y-m-d",$result_date);

echo "<br> This is a readable date from the strtotime function $date";

// please look up the date function on php.net there are meny settimgs for dates.


?>


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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users