Home > Archive > PHP Language > July 2004 > timestamp
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| EniGMistA 2004-07-27, 3:58 pm |
| Hi,
I have 2 timestamp. How can I retrieve hours, minutes and secont between
them?
--
EniGMistA
| |
| Setec Astronomy 2004-07-27, 3:58 pm |
| EniGMistA wrote:
> I have 2 timestamp. How can I retrieve hours, minutes and secont
> between them?
Hi,
you mean UNIX timestamp or MySQL timestamp?
In the first case look http://www.php.net/date , in the second case
loot http://www.php.net/substr
--
I am what I am, I do what I can
L'uomo, conscio di sbagliare, persevera.
| |
|
|
| Colin McKinnon 2004-07-27, 3:58 pm |
| EniGMistA wrote:
> Hi,
> I have 2 timestamp. How can I retrieve hours, minutes and secont between
> them?
>
something like:
$totseconds=$t2-$t1;
$sconds=$totseconds % 60;
$hours=(integer)($totseconds/3600);
$minutes=(integer(($totseconds % 3600)/60);
hth
C.
| |
| EniGMistA 2004-07-27, 3:58 pm |
| > $totseconds=$t2-$t1;
> $sconds=$totseconds % 60;
> $hours=(integer)($totseconds/3600);
> $minutes=(integer(($totseconds % 3600)/60);
Thanks. Olny a mistake:
$minutes=(integer(($totseconds % 3600)/60); >
$minutes=(integer)(($totseconds % 3600)/60);
--
EniGMistA
|
|
|
|
|