1(*
2    Title:      Standard Basis Library: Date Signature
3    Copyright   David Matthews 2000, 2016
4
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License version 2.1 as published by the Free Software Foundation.
8    
9    This library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
13    
14    You should have received a copy of the GNU Lesser General Public
15    License along with this library; if not, write to the Free Software
16    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17*)
18
19signature DATE =
20sig
21     datatype weekday = Mon | Tue | Wed | Thu | Fri | Sat | Sun
22     datatype month = Jan | Feb | Mar | Apr | May | Jun | 
23                      Jul | Aug | Sep | Oct | Nov | Dec
24     type date
25     exception Date
26     val date : {
27                    year : int,
28                    month : month,
29                    day : int,
30                    hour : int,
31                    minute : int,
32                    second : int,
33                    offset : Time.time option
34                  } -> date
35     val year    : date -> int
36     val month   : date -> month
37     val day     : date -> int
38     val hour    : date -> int
39     val minute  : date -> int
40     val second  : date -> int
41     val weekDay : date -> weekday
42     val yearDay : date -> int
43     val offset  : date -> Time.time option
44     val isDst   : date -> bool option
45
46     val localOffset : unit -> Time.time
47
48     val fromTimeLocal : Time.time -> date
49     val fromTimeUniv  : Time.time -> date
50
51     val toTime : date -> Time.time
52
53     val toString : date -> string
54     val fmt      : string -> date -> string
55
56     val fromString : string -> date option
57     val scan       : (char, 'a) StringCvt.reader
58                        -> 'a -> (date * 'a) option
59
60     val compare : date * date -> General.order
61
62end;
63