Mercurial > urweb
comparison lib/ur/datetime.ur @ 1976:98bb0e952a11
Finish datetime -> t rename
author | Patrick Hurst <phurst@mit.edu> |
---|---|
date | Sun, 08 Dec 2013 13:14:58 -0500 |
parents | a10368c65e7f |
children | 50322ba22972 |
comparison
equal
deleted
inserted
replaced
1975:0ee44375fe64 | 1976:98bb0e952a11 |
---|---|
91 | 91 |
92 | 92 |
93 fun toTime dt : time = fromDatetime dt.Year (monthToInt dt.Month) dt.Day | 93 fun toTime dt : time = fromDatetime dt.Year (monthToInt dt.Month) dt.Day |
94 dt.Hour dt.Minute dt.Second | 94 dt.Hour dt.Minute dt.Second |
95 | 95 |
96 fun fromTime t : datetime = { | 96 fun fromTime t : t = { |
97 Year = datetimeYear t, | 97 Year = datetimeYear t, |
98 Month = intToMonth (datetimeMonth t), | 98 Month = intToMonth (datetimeMonth t), |
99 Day = datetimeDay t, | 99 Day = datetimeDay t, |
100 Hour = datetimeHour t, | 100 Hour = datetimeHour t, |
101 Minute = datetimeMinute t, | 101 Minute = datetimeMinute t, |
114 | 5 => Friday | 114 | 5 => Friday |
115 | 6 => Saturday | 115 | 6 => Saturday |
116 | n => error <xml>Illegal day of week {[n]}</xml> | 116 | n => error <xml>Illegal day of week {[n]}</xml> |
117 | 117 |
118 | 118 |
119 val now : transaction datetime = | 119 val now : transaction t = |
120 n <- now; | 120 n <- now; |
121 return (fromTime n) | 121 return (fromTime n) |