[aprssig] MySQL difference in time

w0ep at frii.com w0ep at frii.com
Fri Dec 21 12:46:06 EST 2007



With localtime() and timelocal() you can do about anything.

But like the other reply said, if you just want the interval
it would be more efficient to store the output of time() and
compare it with current time().  That will give you the number
of seconds elapsed since the first event.

If the elapsed time gets to be long (like months and years)
then you have to worry about lengths of months and leap years
and such.  You can either keep the display in days (i.e.  system
has been up 651 days)  or just avoid showing an interval (i.e.  system
has been up since Jun 4, 2004).

Chris
w0ep



On Fri, 21 Dec 2007, Andrew Rich wrote:

> Anyone good at time calcs in perl ?
>
> I want to be able to say "It has been 7 hours 15 minutes" since we last
> heard XYZ
>
> Do I have to go back to unix time ?
>
>
>
> ----------------------------------------------------------------------------
> Andrew Rich VK4TEC
> vk4tec at people.net.au
> http://www.tech-software.net
>
>
>




More information about the aprssig mailing list