Jump to content

convert unix to day and hour


jason213123

Recommended Posts

hi,

 

i want convert the time stamp unix format to hours and days

 

i have this:

 

$date = trim(date('H:i:s', $ofwhat));

 

$ida =  trim(date('d', $ofwhat)) -1;

 

          if ($ida >0) {if ($ida==1) { $dia= $ida. " day, "; } }

 

          if ($ida >0) { if ($ida>1) { $dia= $ida. " days, "; } }

 

 

this work fine in my local pc that have php 4

if i put this:  echo unix2data(3600,4);      they return 1 hour that is correct

 

but when i put in the server running php 5

the    echo unix2data(3600,4);      return 19 hours!

what i doing wrong?

thanks a lot for your help

Link to comment
https://forums.phpfreaks.com/topic/206628-convert-unix-to-day-and-hour/
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.