| bind_function() | ctime() | localtime() |
| mtime() | time() | unbind_function() |
bind_function()
INTEGER bind_function(SYMBOL function, OBJNUM obj)
This function is used to secure other ColdC functions which may have potential security problems. It binds the function specified by the argument function to the object specified by obj. After a function is bound to an object, only methods defined on that object may call the function. The error ~perm is thrown if methods defined on descendants of the object or on any other object call a bound function which is not bound to them.
ctime()
STRING ctime([INTEGER time])
This function converts the integer time into a string format. If time is not specified, then ctime() uses the current time.
ctime(739180536)
=> "Fri Jun 4 03:55:36 1993"
localtime()
LIST localtime([INTEGER time])
This function returns a 12 element list representing the calendar time specified by the argument time. If no argument is given, it will use the current time instead. The elements are taken from struct tm in C and altered as needed to begin at 1 instead of 0. Elements are broken down in the list as follows:
- INTEGER - time (same as returned by the function time()).
- INTEGER - seconds (1-60).
- INTEGER - minutes (1-60).
- INTEGER - hours (1-24)).
- INTEGER - day of month (1-31).
- INTEGER - month in year (1-12).
- INTEGER - year (use year + 1900 for the full year).
- INTEGER - week day (1-7, Sunday=1).
- INTEGER - year day (1-366).
- INTEGER - is daylight savings in effect?
- STRING - time zone name.
- INTEGER - time zone offset from GMT.
mtime()
INTEGER mtime()
If the system the server is on does not have the unix function gettimeofday() then this function will return -1. If it does, this function will return the current microseconds, from the C structure struct timeval. This is useful in certain situations, but in general its granularity is too fine for most cases. This will only work if Genesis is running on some unix systems.
time()
INTEGER time()
This function returns the system time in seconds since midnight GMT, January 1, 1970. The functions ctime() and localtime() can be used in manipulating this number.
unbind_function()
INTEGER unbind_function(SYMBOL function)
This function unbinds a function from the current object. The function is specified by the argument function.