src/pylib/Lib/n_time

Source   Edit  

time for Nim

the only difference with Python's is where some types in time is str, there is string in n_time's.

e.g. n_time.ctime() returns a string

py diff

Currently, tm_name is either "LOCAL" or "Etc/UTC", due to std/times only returning those two.

Consts

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

Procs

proc asctime(): string {....raises: [], tags: [TimeEffect], forbids: [].}
Source   Edit  
func asctime(t: struct_time): string {....raises: [], tags: [], forbids: [].}
Source   Edit  
func asctime(tup: struct_time_tuple): typeof(asctime do:
  bind struct_time
  struct_time(tm_year: 1900, tm_mon: 1, tm_mday: 1, tm_yday: 1, tm_isdst: -1)) {.
    ...raises: [], tags: [], forbids: [].}
Source   Edit  
func asctime(tup: struct_time_tuple10): typeof(asctime do:
  bind struct_time
  struct_time(tm_year: 1900, tm_mon: 1, tm_mday: 1, tm_yday: 1, tm_isdst: -1)) {.
    ...raises: [], tags: [], forbids: [].}
Source   Edit  
func asctime(tup: struct_time_tuple11): typeof(asctime do:
  bind struct_time
  struct_time(tm_year: 1900, tm_mon: 1, tm_mday: 1, tm_yday: 1, tm_isdst: -1)) {.
    ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc ctime(): string {....raises: [], tags: [TimeEffect], forbids: [].}
Source   Edit  
proc ctime(secs: float | int64): string
Source   Edit  
proc strftime(format: string): string {....raises: [], tags: [TimeEffect],
                                        forbids: [].}
Source   Edit  
proc strptime(s: string): struct_time {....raises: [ValueError, TimeParseError,
    TimeFormatParseError], tags: [TimeEffect], forbids: [].}
Source   Edit