MrLarkins.com Posted October 13, 2006 Share Posted October 13, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/23895-what-kind-of-date-is-this/ Share on other sites More sharing options...
lead2gold Posted October 13, 2006 Share Posted October 13, 2006 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() Quote Link to comment https://forums.phpfreaks.com/topic/23895-what-kind-of-date-is-this/#findComment-108601 Share on other sites More sharing options...
kenrbnsn Posted October 13, 2006 Share Posted October 13, 2006 You can also use the [url=http://www.php.net/date]date()[/url] function.[code]<?php$date = "1072806465";echo date('j-F Y',$date);?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/23895-what-kind-of-date-is-this/#findComment-108604 Share on other sites More sharing options...
redbullmarky Posted October 13, 2006 Share Posted October 13, 2006 [quote author=lead2gold link=topic=111439.msg451652#msg451652 date=1160770976]probably unix time.. it's the amount of seconds between now and Jan-1980.[/quote]just to correct on this point, a timestamp like this is the number of seconds passed since 12:00:00am, 1st Jan 1970. Quote Link to comment https://forums.phpfreaks.com/topic/23895-what-kind-of-date-is-this/#findComment-108633 Share on other sites More sharing options...
hanlonj Posted October 13, 2006 Share Posted October 13, 2006 And just to further add to this, that date (1st Jan 1970)is known as the "Unix Epoch"HJ Quote Link to comment https://forums.phpfreaks.com/topic/23895-what-kind-of-date-is-this/#findComment-108639 Share on other sites More sharing options...
redarrow Posted October 14, 2006 Share Posted October 14, 2006 A lttle help for you.[code]<?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.?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/23895-what-kind-of-date-is-this/#findComment-108695 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.