Zymba Documentation
Date
Text
object @Date() {
FORMAT_ISO8601;
FORMAT_ISO9075;
FORMAT_RFC1036;
FORMAT_RFC1123;
FORMAT_RFC2822;
FORMAT_RFC3339;
FORMAT_RFC822;
FORMAT_RFC850;
JUDGMENTDAY;
create(?int $day, ?int $month, ?int $year, int $hour, int $minute, int $second): int {}
createUTC(?int $day, ?int $month, ?int $year, int $hour, int $minute, int $second): int {}
format(string $format, ?int $timestamp): string {}
formatUTC(string $format, ?int $timestamp): string {}
getDay(?int $timestamp): int {}
getDayOfWeek(?int $timestamp): int {}
getDayOfWeekISO8601(?int $timestamp): int {}
getDayOfYear(?int $timestamp): int {}
getDaysInMonth(?int $timestamp): int {}
getHour(?int $timestamp): int {}
getMinute(?int $timestamp): int {}
getMonth(?int $timestamp): int {}
getSecond(?int $timestamp): int {}
getTimezone(): string {}
getTimezoneAbbreviation(): string {}
getTimezoneOffset(): int {}
getWeekISO8601(?int $timestamp): int {}
getYear(?int $timestamp): int {}
getYearISO8601(?int $timestamp): int {}
inDST(?int $timestamp): bool {}
isLeapYear(?int $timestamp): bool {}
isMidnight(?int $timestamp): bool {}
isValid(?int $day, ?int $month, ?int $year): bool {}
listTimezones(): object {}
now(): int {}
nowExact(): float {}
parse(string $string): int {}
today(): int {}
truncateDay(?int $timestamp): int {}
truncateMonth(?int $timestamp): int {}
truncateYear(?int $timestamp): int {}
}
Static date and time related constants and functions.
Functions
Creates the timestamp of a Gregorian date formed by its components using UTC instead of local time.
CODE
@Date.createUTC(?int $day, ?int $month, ?int $year, int $hour, int $minute, int $second): int
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| day | ?int | now | |
| month | ?int | now | |
| year | ?int | now | |
| hour | int | 0 | |
| minute | int | 0 | |
| second | int | 0 |
Returns
| Type | Value |
|---|---|
int |
Gets the current time zone name as defined by the IANA Time Zone Database.
CODE
@Date.getTimezone(): string
Returns
| Type | Value |
|---|---|
string |
Gets the current time zone abbreviation.
CODE
@Date.getTimezoneAbbreviation(): string
Returns
| Type | Value |
|---|---|
string |
Gets the current time zone offset in number of seconds from UTC.
CODE
@Date.getTimezoneOffset(): int
Returns
| Type | Value |
|---|---|
int |
List all available time zones.
CODE
@Date.listTimezones(): object
Returns
| Type | Value |
|---|---|
object | [timezone, ...] |
Returns the exact timestamp for the current date and time including microseconds in the fractional part.
CODE
@Date.nowExact(): float
Returns
| Type | Value |
|---|---|
float |