src/pylib/Lib/time

Source   Edit  

time

Currently the implementation is n_time module . The following is its doc:

Consts

DefaultTimeFormat = "%a %b %d %H:%M:%S %Y"
Source   Edit  

Procs

proc asctime(): PyStr {....raises: [], tags: [TimeEffect], forbids: [].}
Source   Edit  
func asctime(t: Some_struct_time): PyStr

Example:

assert asctime(gmtime(0)) == "Thu Jan  1 00:00:00 1970"
Source   Edit  
proc ctime(): PyStr {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc ctime(secs: float | int64): PyStr
Source   Edit  
proc strftime(format: PyStr): PyStr {....raises: [], tags: [TimeEffect],
                                      forbids: [].}
Source   Edit  
func strftime(format: PyStr; st: Some_struct_time): PyStr
Source   Edit  
proc strptime(s: PyStr; format = DefaultTimeFormat): struct_time {.
    ...raises: [ValueError, TimeParseError, TimeFormatParseError],
    tags: [TimeEffect], forbids: [].}
Source   Edit