[1032] in Coldmud discussion meeting

root meeting help first previous next next in chain last in chain last

[COLD] behaviour of localtime()

daemon@ATHENA.MIT.EDU (Tue Jul 23 12:00:12 1996 )

Date: Tue, 23 Jul 1996 09:18:43 -0600 (MDT)
From: Brandon Gillespie <brandon@tombstone.sunrem.com>
To: coldstuff@cold.org


Right now localtime works like:

    1. INTEGER time (same as returned by the function time()) 
    2. INTEGER seconds (0-59) 
    3. INTEGER minutes (0-59) 
    4. INTEGER hours (0-23)) 
    5. INTEGER day of month (1-31) 
    6. INTEGER month in year (0-11) 
    7. INTEGER year 
    8. INTEGER week day (0-6) 
    9. INTEGER year day (0-365) 
   10. INTEGER is daylight savings in effect? 
   11. STRING time zone name 

Which is basically a raw dump of the C function localtime().  Because 
Cold scales arrays starting at one rather than zero, I think I will change 
it to add one to elements 2 - 9 (excluding the year and day of the month), 
instead giving you:

    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-32)
    6. INTEGER month in year (1-12)
    7. INTEGER 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

The reason for this is any likely use of localtime() in ColdC will 
inevitably require you to add one to the value, so why not do it in 
native code rather than interpreted code?

-Brandon Gillespie