Cold Help System: Programming: ColdC Reference Manual: Functions: Misc: localtime()


LIST localtime([INTEGER time])

This function returns an 11 element list representing the 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 one instead of zero. Elements are broken down in the list as follows:

  1. INTEGER time (same as returned by the function time())
  2. INTEGER seconds (1-60)
  3. INTEGER minutes (1-60)
  4. INTEGER hours (1-24))
  5. INTEGER day of month (1-31)
  6. INTEGER month in year (1-12)
  7. INTEGER year (use year + 1900 for the full year)
  8. INTEGER week day (1-7, Sunday=1)
  9. INTEGER year day (1-366)
  10. INTEGER is daylight savings in effect?
  11. STRING time zone name
  12. INTEGER timezone offset in seconds from GMT

Note: there is one bug, in order to optimize the speed of this function the timezone name (as a string) is cached. This will mean that if the timezone name changes while genesis is running the name will not update correctly.


bind_function() | ctime() | localtime() | mtime() | time() | unbind_function()


the Cold Dark