alice
library
manual.

Alice Project

The Date structure


________ Synopsis ____________________________________________________

    signature DATE
    structure Date : DATE
  

An extended version of the Standard ML Basis' Date structure.

See also: Time


________ Import ______________________________________________________

Imported implicitly.


________ Interface ___________________________________________________

    signature DATE =
    sig
	datatype weekday = Sun | Mon | Tue | Wed | Thu | Fri | Sat
	datatype month = Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec
	type date
	type t = date

	exception Date
    
	val date :          {year :   int,
			     month :  month,
			     day :    int,
			     hour :   int,
			     minute : int,
			     second : int,
			     offset : Time.time option} -> date

	val year :          date -> int
	val month :         date -> month
	val day :           date -> int
	val hour :          date -> int
	val minute :        date -> int
	val second :        date -> int
	val weekDay :       date -> weekday
	val yearDay :       date -> int
	val offset :        date -> Time.time option
	val isDst :         date -> bool option

	val localOffset :   unit -> Time.time

	val fromTimeLocal : Time.time -> date
	val fromTimeUniv :  Time.time -> date
	val toTime :        date -> Time.time

	val fmt :           string -> date -> string
	val toString :      date -> string
	val scan :          (char, 'a) StringCvt.reader -> (date, 'a) StringCvt.reader
	val fromString :    string -> date option

	val toISO :	    date -> string
	val scanISO :	    (char, 'a) StringCvt.reader -> (date, 'a) StringCvt.reader
	val fromISO :	    string -> date option

	val compare :       date * date -> order
    end
  

________ Description _________________________________________________

Items not described here are as in the Standard ML Basis' Date structure.

type t = date

A local synonym for type date.

toISO date

Return a string representation of the date date conforming to the ISO 8601 format.

fromISO repr

Convert a string representation conforming to the ISO 8601 format into a date. Returns NONE if the string could not be converted.

scanISO getc s

Scan a string representation conforming to the ISO 8601 format into a date. Returns NONE if the scanned representation could not be converted.



last modified 2007/Mar/30 17:10