rosetta/internal/erl/stdlib/r_calendar
Types
pub type Datetime1970 =
#(Year1970, Month, Date, Time)
FIXME - not supported yet
pub type Rfc3339String
pub type Rfc3339TimeUnit {
Microsecond
Millisecond
Nanosecond
Second
Native
}
Constructors
-
Microsecond
-
Millisecond
-
Nanosecond
-
Second
-
Native
pub type SecsPerDay =
Int
Options for function r_system_time_to_rfc339_2
Partially broken.
pub type TimeToRfcOptions {
Offset(offset: Offset)
TimeDesignator(designator: r_erlang.Byte)
Unit(unit: Rfc3339TimeUnit)
}
Constructors
-
Offset(offset: Offset)
FIXME: This does not fully conform to what we have here. The offset, either a string or an integer, to be included in the formatted string. An empty string, which is the default, is interpreted as local time. A non-empty string is included as is. The time unit of the integer is the same as the one of Time.
-
TimeDesignator(designator: r_erlang.Byte)
The character used as time designator, that is, the date and time separator. The default is
$T
. -
Unit(unit: Rfc3339TimeUnit)
The time unit of Time. The default is second. If some other unit is given (millisecond, microsecond, nanosecond, or native), the formatted string includes a fraction of a second. The number of fractional second digits is three, six, or nine depending on what time unit is chosen. For native three fractional digits are included. Notice that trailing zeros are not removed from the fraction.
pub type Yearweeknum =
#(Year, Weeknum)
Functions
pub fn r_date_to_gregorian_days_1(
date date: #(Int, Int, Int),
) -> Int
date_to_gregorian_days/1 Computes the number of gregorian days starting with year 0 and ending at the specified date. Shall return “non-negative integer”. Simplified for brevity.
pub fn r_date_to_gregorian_days_3(
year year: Int,
month month: Int,
day day: Int,
) -> Int
date_to_gregorian_days/3 Returns non-negative integer
pub fn r_datetime_to_gregorian_seconds_1(
datetime datetime: #(#(Int, Int, Int), #(Int, Int, Int)),
) -> Int
datetime_to_gregorian_seconds/1 Computes the number of gregorian seconds starting with year 0 and ending at the specified date and time.
pub fn r_day_of_the_week_1(
datetime datetime: #(#(Int, Int, Int), #(Int, Int, Int)),
) -> Int
day_of_the_week/1
pub fn r_day_of_the_week_3(
year year: Int,
month month: Int,
day day: Int,
) -> Int
day_of_the_week/3
pub fn r_gregorian_days_to_date_1(
date date: Int,
) -> #(Int, Int, Int)
gregorian_days_to_date/1
pub fn r_gregorian_seconds_to_datetime_1(
seconds seconds: Int,
) -> #(#(Int, Int, Int), #(Int, Int, Int))
gregorian_seconds_to_datetime/1
pub fn r_iso_week_number_0() -> #(Int, Int)
pub fn r_iso_week_number_1(
date date: #(Int, Int, Int),
) -> #(Int, Int)
iso_week_number/1 Returns tuple {Year, WeekNum} representing the ISO week number for the specified date.
pub fn r_last_day_of_the_month_2(
year year: Int,
month month: Int,
) -> Int
pub fn r_local_time_0() -> #(#(Int, Int, Int), #(Int, Int, Int))
local_time/0 Returns the local time reported by the underlying operating system.
pub fn r_local_time_to_universal_time_1(
datetime datetime: #(
Int,
Int,
#(Int, Int, Int),
#(Int, Int, Int),
),
) -> #(Int, Int, #(Int, Int, Int), #(Int, Int, Int))
Deprecated: This function is deprecated. calendar:local_time_to_universal_time/1 is deprecated; use calendar:local_time_to_universal_time_dst/1 instead.
pub fn r_local_time_to_universal_time_dst_1(
datetime datetime: #(
Int,
Int,
#(Int, Int, Int),
#(Int, Int, Int),
),
) -> #(Int, Int, #(Int, Int, Int), #(Int, Int, Int))
local_time_to_universal_time_dst/1
Converts from local time to Universal Coordinated Time (UTC). datetime
must refer to a local date after Jan 1, 1970.
pub fn r_now_to_datetime_1(
now now: #(Int, Int, Int),
) -> #(Int, Int, #(Int, Int, Int), #(Int, Int, Int))
now_to_datetime/1
pub fn r_now_to_local_time_1(
now now: #(Int, Int, Int),
) -> #(Int, Int, #(Int, Int, Int), #(Int, Int, Int))
now_to_local_time/1
pub fn r_now_to_universal_time_1(
now now: #(Int, Int, Int),
) -> #(Int, Int, #(Int, Int, Int), #(Int, Int, Int))
now_to_universal_time/1
pub fn r_rfc3339_to_system_time_1(
datetimestring datetimestring: Rfc3339String,
) -> Int
rfc3339_to_system_time/1
pub fn r_rfc3339_to_system_time_2(
datetimestring datetimestring: Rfc3339String,
options options: Rcf3339ToSystem,
) -> Int
rfc3339_to_system_time/2 FIXME: Lacking options type
pub fn r_seconds_to_daystime_1(
seconds seconds: Int,
) -> #(Int, #(Int, Int, Int))
seconds_to_daystime/1 TODO: This could probably have its own type
pub fn r_system_time_to_local_time_2(
time time: Int,
timeunit timeunit: ROSETTABROKEN,
) -> #(#(Int, Int, Int), #(Int, Int, Int))
system_time_to_local_time/2
pub fn r_system_time_to_rfc3339_1(
time time: Int,
) -> Rfc3339String
system_time_to_rfc3339/1
pub fn r_system_time_to_rfc3339_2(
time time: Int,
options options: List(TimeToRfcOptions),
) -> Rfc3339String
pub fn r_system_time_to_universal_time_2(
time time: Int,
timeunit timeunit: ROSETTABROKEN,
) -> #(#(Int, Int, Int), #(Int, Int, Int))
system_time_to_universal_time/2
pub fn r_time_difference_2(arg1: Nil, arg2: Nil) -> Nil
Deprecated: This function is obsolete. Use the conversion functions for gregorian days and seconds instedad.
time_difference/2
pub fn r_time_to_seconds_1(time time: #(Int, Int, Int)) -> Int
time_to_seconds/1 Returns the number of seconds since midnight up to the specified time.
pub fn r_universal_time_0() -> #(
#(Int, Int, Int),
#(Int, Int, Int),
)
universal_time/0 Returns the Universal Coordinated Time (UTC) reported by the underlying operating system. Returns local time if universal time is unavailable.
pub fn r_universal_time_to_local_time_1(
datetime datetime: #(
Int,
Int,
#(Int, Int, Int),
#(Int, Int, Int),
),
) -> #(#(Int, Int, Int), #(Int, Int, Int))
universal_time_to_local_time/1 Converts from Universal Coordinated Time (UTC) to local time. DateTime must refer to a date after Jan 1, 1970.
pub fn r_valid_date_1(date date: #(Int, Int, Int)) -> Bool
valid_date/1 This function checks if a date is a valid.
pub fn r_valid_date_3(
year year: Int,
month month: Int,
day day: Int,
) -> Bool
valid_date/3 This function checks if a date is a valid. Equivalent of r_valid_date_1