W3C

n3 definition of some time and date functions

Based on orginal cwm_date and cwm_time by Mark Nottingham

The vocabulary is published by the W3C Notation-3 Community Group.

Vocabulary Terms

Property Definitions
time:day day (link)

Iff the subject is a xsd:dateTime and the object is the integer day component of the dateTime. the object can be calculated as a function of the subject.

rdfs:domain
xsd:dateTime
rdfs:range
xsd:integer
time:dayOfWeek day of week (link)

Iff the subject is a xsd:dateTime and the object is the integer the day number within the week, Sunday being 0. the object can be calculated as a function of the subject.

rdfs:domain
xsd:dateTime
rdfs:range
xsd:integer
time:gmTime Universal Time (link)

Iff the subject is a dateTime format string and the object is the result of formatting the Universal Time of processing in the format given. If the format string has zero length, then the ISOdate standard format is used. [ is time:gmtime of ""] the therefore the current date time. It will end with "Z" as a timezone code. the object can be calculated as a function of the subject. Rules which use this function will of course NOT be repeatable.

rdfs:domain
time:format
rdfs:range
xsd:string
time:hour hour (link)

Iff the subject is a xsd:dateTime and the object is the integer hours component of the dateTime. the object can be calculated as a function of the subject.

rdfs:domain
xsd:dateTime
rdfs:range
xsd:integer
time:inSeconds in era seconds (link)

Iff the subject is a xsd:dateTime and the object is the integer number of seconds since the beginning of the era on a given system. Don't assume a particular value, always test for it. the object can be calculated as a function of the subject.

Cwm implements this as a bidirectional function: you can calculate the ISO date from the seconds since the beginning of the era, or vice-versa.

rdfs:domain
xsd:dateTime
rdfs:range
xsd:integer
time:localTime local time (link)

Iff the subject is a dateTime format string and the object is the result of formatting the current time of processing and local timezone in the format given. If the format string has zero length, then the ISOdate standard format is used. [ is time:gmtime of ""] the therefore the current date time. It will end with "Z" as a timezone code. the object can be calculated as a function of the subject. Rules which use this function will of course NOT be repeatable.

rdfs:domain
time:format
rdfs:range
xsd:string
time:minute minute (link)

Iff the subject is a xsd:dateTime and the object is the integer minutes component of the dateTime. the object can be calculated as a function of the subject.

rdfs:domain
xsd:dateTime
rdfs:range
xsd:integer
time:month month (link)

Iff the subject is a xsd:dateTime and the object is the integer month component of the dateTime. the object can be calculated as a function of the subject.

rdfs:domain
xsd:dateTime
rdfs:range
xsd:integer
time:second second (link)

Iff the subject is a xsd:dateTime and the object is the integer seconds component of the dateTime. the object can be calculated as a function of the subject.

rdfs:domain
xsd:dateTime
rdfs:range
xsd:integer
time:timeZone timezone offset (link)

Iff the subject is a xsd:dateTime and the object is the trailing timezone offset part, e.g. "-05:00".. the object can be calculated as a function of the subject.

rdfs:domain
xsd:dateTime
rdfs:range
xsd:string
time:year year (link)

Iff the subject is a xsd:dateTime and the object is the integer year component of the dateTime. the object can be calculated as a function of the subject.

rdfs:domain
xsd:dateTime
rdfs:range
xsd:integer