ocean.time.ISO8601

This module is based on the ISO 8601:2004 standard, and has functions for parsing (almost) every date/time format specified therein. (The ones not supported are intervals, durations, and recurring intervals.)

Refer to the standard for a full description of the formats supported.

The functions (parseTime, parseDate, and parseDateAndTime) are overloaded into two different versions of each: one updates a given Time, and the other updates a given ExtendedDate struct. The purpose of this struct is to support more detailed information which the Time data type does not (and, given its simple integer nature, cannot) support.

Times with specified time zones are simply converted into UTC: this may lead to the date changing when only a time was parsed: e.g. "01:00+03" is the same as "22:00", except that when the former is parsed, one is subtracted from the day.

Public Imports

ocean.time.Time
public import ocean.time.Time;
Undocumented in source.
ocean.time.chrono.Gregorian
public import ocean.time.chrono.Gregorian;
Undocumented in source.

Members

Functions

parseDate
size_t parseDate(T[] src, DT dt)
size_t parseDate(T[] src, FullDate fd, ubyte expanded)

Parses a date in a format specified in ISO 8601:2004.

parseDateAndTime
size_t parseDateAndTime(T[] src, FullDate fd)

Parses a combined date and time in a format specified in ISO 8601:2004.

parseDateAndTime
size_t parseDateAndTime(T[] src, DT dt)

Parses a combined date and time in a format specified in ISO 8601:2004.

parseTime
size_t parseTime(T[] src, DT dt)
size_t parseTime(T[] src, FullDate fd)

Parses a time of day in a format specified in ISO 8601:2004.

Structs

ExtendedDate
struct ExtendedDate

An extended date type, wrapping a Time together with some additional * information.

Meta

License

Tango Dual License: 3-Clause BSD License / Academic Free License v3.0. See LICENSE_TANGO.txt for details.

Version

Aug 2007: Initial release Feb 2008: Retooled

Authors

Matti Niemenmaa