tecdesign Posted April 26, 2006 Share Posted April 26, 2006 how do I turn a time stamp when posted looks like this 20060426152138 into something readable like26th 04 2006 15:21pm or something that looks good. Quote Link to comment Share on other sites More sharing options...
zq29 Posted April 26, 2006 Share Posted April 26, 2006 [code]echo date("l jS \of F Y h:i:s A", $timestamp);[/code]Check the date() page in the manual for more information on how to format it. Quote Link to comment Share on other sites More sharing options...
tecdesign Posted April 26, 2006 Author Share Posted April 26, 2006 [!--quoteo(post=368761:date=Apr 25 2006, 08:30 PM:name=SemiApocalyptic)--][div class=\'quotetop\']QUOTE(SemiApocalyptic @ Apr 25 2006, 08:30 PM) [snapback]368761[/snapback][/div][div class=\'quotemain\'][!--quotec--][code]echo date("l jS \of F Y h:i:s A", $timestamp);[/code]Check the date() page in the manual for more information on how to format it.[/quote]In my database it reads this 20060427062251 which is right but in website it is posting 19 01 38 which is d m y which in long form it goes to tuesday 19th of january 2038? Does anyone know what could be causing this? Quote Link to comment Share on other sites More sharing options...
zq29 Posted April 26, 2006 Share Posted April 26, 2006 I think we got our wires crossed on the whole timestamp thing - I just glanced at your timestamp and assumed it was a *NIX timestamp. Upon looking at it in more detail it looks like its just the year, month, date, hour, minute and second all in one string... In which case you can just chop it up with substr() I guess, unless theres a function that does this for you, I cant think of one off the top of the head.[code]<?php$str = "20060426152138";$year = substr($str,0,4);$month = substr($str,4,2);$day = substr($str,6,2);$hour = substr($str,8,2);$minute = substr($str,10,2);$second = substr($str,12,2);?>[/code] Quote Link to comment 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.