Index
Overview
time defines time primitives for starlark
Functions
def duration
duration(string) duration
parse a duration
def fromtimestamptime
fromtimestamptime(int) time
parse a Unix timestamp
def location
location(string) location
parse a location
def now
now() time
implementations would be able to make this a constant
def time
time(string, format=..., location=...) time
parse a time
def zero
zero() time
a constant
Types
type duration
Properties
name | type | description |
---|---|---|
hours | float | |
minutes | float | |
nanoseconds | int | |
seconds | float |
type time
Methods
def time.year
time.year() int
def time.month
time.month() int
def time.day
time.day() int
def time.hour
time.hour() int
def time.minute
time.minute() int
def time.second
time.second() int
def time.nanosecond
time.nanosecond() int
def time.unix
time.unix() int
def time.unix_nano
time.unix_nano() int
def time.in_location
time.in_location(string) time
get time representing the same instant but in a different location
def time.format
time.format(string) string
textual representation of time formatted according to the provided layout string
def time.strftime
time.strftime(string) string
textual representation of time formatted according to the provided C-style strftime format string layout string
Operators
operator | description |
---|---|
time == time = boolean | |
time < time = boolean | |
time + duration = time | |
time - duration = time | |
time - time = duration |