Site Tools


time_function

# $EPIC: time_function.txt,v 1.4 2007/07/10 22:09:59 jnelson Exp $

Synopsis:

$time()

Technical:

  • All arguments, if any, are ignored.
  • This function calls your system's time(3) function, which typically returns the number of seconds since the epoch, 1970 Jan 1 00:00:00 GMT.
  • In theory, every unix host should have the same time as every other unix host, but getting everyone to agree on the time is like herding cats.
  • If you need sub-second resolution, use the $utime() function.

Practical:

You can convert the UTC value into human readable format using either the $stime() function or the $strftime() function. You can also use the UTC value for tracking the elapsed time between two events.

Returns:

The number of seconds that have elapsed since the epoch.

Examples:

$time()      might return "850381369"

History:

This function first appeared in ircII.

time_function.txt · Last modified: 2007/07/10 22:09 by 127.0.0.1