Re: [PHP] convert unix time to Gregorian



On Sun, Apr 27, 2008 at 12:27 PM, Yui Hiroaki <hiroakiyui@xxxxxxxxx> wrote:

hi!
I am try to change unix time to Gregorian.

I successfully convert unix time to Gregorian.
But Gregorian time is now showing hour and second and more detail time.

<?php
$unix_timestamp="1208764059";
echo "$unix_timestamp"."\tUnix Time Stamp"."<br />";
$julius=unixtojd($unix_timestamp);
$Gregorian=jdtogregorian("$julius");
echo "$Gregorian";
?>

Above code showing the result only date and year.

ie
1208764059 Unix Time Stamp
2454578 //julius
4/21/2008 //Gregorian <-----


I need to see hour and time or more detail time.

If some knows convert Unix time stamp to Gregorian with hour and second,
please teach me how!


have you tried the date function ?

<?php
echo date('M d, Y g:m:s', 1208764059);
?>
Apr 21, 2008 3:04:39

-nathan


Relevant Pages

  • convert unix time to Gregorian
    ... I successfully convert unix time to Gregorian. ... But Gregorian time is now showing hour and second and more detail time. ... If some knows convert Unix time stamp to Gregorian with hour and second, ...
    (php.general)
  • Date string to UNIX time in SWI Prolog?
    ... format 'YYYYMMDD' to the corresponding UNIX time stamp (i.e. seconds since ... But these only allow converting from a unix time to some other ...
    (comp.lang.prolog)
  • Convert UNIX time to windows general date
    ... I'm importing a table from a MYSQL database that contains a UNIX time stamp ... data field. ...
    (microsoft.public.access.queries)