document c types

This commit is contained in:
2025-02-09 00:00:40 -06:00
parent 95c64f51de
commit 7cffdab28a
89 changed files with 4133 additions and 1390 deletions

View File

@@ -1,57 +1,55 @@
# time
# time
The main time object, handling date/time utilities in earth-seconds.
## now()
### now
Return the current system time in seconds (implemented in C extension).
## computer_dst()
### computer_dst
Return true if local system time is currently in DST (implemented in C extension).
## computer_zone()
### computer_zone
Return local time zone offset from UTC in hours (implemented in C extension).
## hour2minute()
### hour2minute
Return the ratio of hour to minute in seconds, e.g. 3600 / 60 => 60.
## day2hour()
### day2hour
Return the ratio of day to hour in seconds, e.g. 86400 / 3600 => 24.
## minute2second()
### minute2second
Return the ratio of minute to second in seconds, e.g. 60 / 1 => 60.
## week2day()
### week2day
Return the ratio of week to day in seconds, e.g. 604800 / 86400 => 7.
## isleap(year)
### isleap(year)
Return true if a given year is leap, based on whether it has 366 days.
## yearsize(y)
### yearsize(y)
Given a year, return 365 or 366 depending on leap-year rules.
## timecode(t, fps = 24)
### timecode(t, fps = 24)
Convert seconds into a "S:frames" timecode string, with optional FPS (default 24).
## record(num, zone = this.computer_zone()
### record(num, zone = this.computer_zone()
Convert a timestamp (in seconds) into a record with fields like day, month, year, etc.
## number(rec)
### number(rec)
Convert a record back into a numeric timestamp (seconds).
## text(num, fmt = this.fmt, zone)
### text(num, fmt = this.fmt, zone)
Format a numeric or record time into a string using a format pattern, e.g. 'hh:nn:ss'.