Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   Web design and Programming (https://novahq.net/forum/forumdisplay.php?f=32)
-   -   Linux time to standard mm/dd (https://novahq.net/forum/showthread.php?t=9609)

BeBop 08-11-2003 06:12 PM

Linux time to standard mm/dd
 
code to convert linux time ( ex: 1060640800 ) to standard something like (this is wrong) August 10, 2003 or just August 10

SilentTrigger 08-12-2003 02:47 PM

PHP Code:

<?$time = ("Unix(Linux as you said) time code"); echo date ("Date time code, ie: Y i s", $time);?>

Example

PHP Code:

<?
$time = ("1060715196");
echo date ("Y i s", $time);
?>

Example would produce:

2003 06 14

Example 2

PHP Code:

<?
$time = ("1060715196");
echo date ("r", $time);
?>

Example 2 would produce:

Tue, 12 Aug 2003 21:06:14 +0200

Enjoy :)

I do hope you ment PHP, but im asuming because you said "Linux" ;)

BeBop 08-12-2003 05:09 PM

thanks man, i did mean unix/linux pretty much whats used, its from some date i think 1970, 01/01

SilentTrigger 08-12-2003 05:14 PM

Correct! :)

The number of seconds from the UNIX Epoch :)

You can do it manualy and devide the seconds into days and then put that on to Jan 1 1970 But it would probebly not be that quick, and probebly not as acurret hehe :confused:

BeBop 08-12-2003 09:13 PM

ack one prob, its displaying Wednesday 1969, December 31 :) the night/hour before said 'epoch' lol :) im not that old yet so thats not right lol

http://punksofwar.com/gn

SilentTrigger 08-13-2003 09:17 AM

Then its probebly not seconds from the UNIX epoch your using...

Or you must be doing something wrong, I cant see what from looking at "Wednesday, Dec 31"


Code to generate unix timestamp
PHP Code:

date("U"); 



All times are GMT -5. The time now is 11:58 AM.

Powered by vBulletin®