Description
View of string where the value represents a date and time. Internally dates are represented as 64 bit integers that are milliseconds after January 1, 1970 00:00:00 GMT. Externally dates are strings such as the following example.
2006/09/28 10:22:34.881 PDTA date string consist of the following numeric parts. A numeric part may be omitted, but then all following numeric parts must also be omitted. If a numeric part is omitted the default value is the minimum permitted. There is no default value for year.
name | separator | value |
year | "2006" | |
month | "/" | "09" |
day | "/" | "28" |
hour | " " | "10" |
minute | ":" | "22" |
second | ":" | "34" |
millisecond | "." | "881" |
This can optionally be followed by a time zone. The default for time zone is the local time zone.
name | separator | value |
timezone | " " | "PDT" |
Examples of how to use the date view can be found in the date example.
View date
@x:view date
View Function sys:Is
@x:func sys:Is(v~boolean)~boolean | ||
|
Semantics
The result is true if val is a string that represents a date.View Function sys:Make
@x:func sys:Make(val~date, |
||||||||||||||||||
|
Semantics
If val is present, it forms the initial value. If val is not present, year must be present and the initial value is formed from that year and default values for all other fields.
For each named parameter the initial value is modified for that field to the specified value. The overall result is the result of applying all these modifications to the initial value.
View Function now
@x:func now()~date |
|
Semantics
The current date in the local timezone.View Function gmt
@x:func gmt()~date |
|
Semantics
The current date in GMT (Greenwich Mean Time).View Function sys:Sub
@x:func sys:Sub(a~date, |
||||
|
Semantics
The result is the number of milliseconds that a is after b.View Function sys:Eq
@x:func sys:Eq(a~date, |
||||
|
Semantics
If a and b have the same date value, then the result is true, else the result is false.View Function sys:Ne
@x:func sys:Ne(a~date, |
||||
|
Semantics
If a and b have the same date value, then the result is false, else the result is true.View Function sys:Less
@x:func sys:Less(a~date, |
||||
|
Semantics
If a is less than b, then the result is true, else the result is false.View Function sys:LessEq
@x:func sys:LessEq(a~date, |
||||
|
Semantics
If a is less than or equal to b, then the result is true, else the result is false.View Function sys:Greater
@x:func sys:Greater(a~date, |
||||
|
Semantics
If a is greater than b, then the result is true, else the result is false.View Function sys:GreaterEq
@x:func sys:GreaterEq(a~date, |
||||
|
Semantics
If a is greater than or equal to b, then the result is true, else the result is false.Self Const year
@x:const year~int |
Semantics
The year part of the date.Self Const month
@x:const month~int |
Semantics
The month part of the date (1..12.Self Const day
@x:const day~int |
Semantics
The day part of the date (1..31.Self Const hour
@x:const hour~int |
Semantics
The hour part of the date (0..23.Self Const minute
@x:const minute~int |
Semantics
The minute part of the date (0..59.Self Const second
@x:const second~int |
Semantics
The second part of the date (0..59.Self Const millisecond
@x:const millisecond~int |
Semantics
The millisecond part of the date (0..999.Self Const dayOfWeek
@x:const dayOfWeek~int |
Semantics
The day of the week (0..6. Sunday has value 0.Self Const dayOfYear
@x:const dayOfYear~int |
Semantics
The day of the year (1..366. January 1 has value 1.Self Const timeZone
@x:const timeZone~string |
Semantics
The time zone part of the date.Self Const timeZoneLong
@x:const timeZoneLong~string |
Semantics
The long form of the time zone part of the date.Self Const dst
@x:const dst~boolean |
Semantics
If the date is in daylight savings time the result is true.Self Function add
@x:func add(year=year1~int, |
||||||||||||||||
|
Semantics
The result starts with the self data and then applies any deltas or timezone changes and returns that new date.