Jump to content

timestamp


tecdesign

Recommended Posts

[!--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?
Link to comment
https://forums.phpfreaks.com/topic/8439-timestamp/#findComment-31038
Share on other sites

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]
Link to comment
https://forums.phpfreaks.com/topic/8439-timestamp/#findComment-31049
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.