phurst@1972: type datetime = { phurst@1972: Year : int, phurst@1972: Month : int, phurst@1972: Day : int, phurst@1972: Hour : int, phurst@1972: Minute : int, phurst@1972: Second : int phurst@1972: } phurst@1972: phurst@1972: fun toTime dt : time = fromDatetime dt.Year dt.Month dt.Day phurst@1972: dt.Hour dt.Minute dt.Second phurst@1972: phurst@1972: fun fromTime t : datetime = { phurst@1972: Year = datetimeYear t, phurst@1972: Month = datetimeMonth t, phurst@1972: Day = datetimeDay t, phurst@1972: Hour = datetimeHour t, phurst@1972: Minute = datetimeMinute t, phurst@1972: Second = datetimeSecond t phurst@1972: } phurst@1972: phurst@1972: fun datetimef fmt dt : string = timef fmt (toTime dt) phurst@1972: phurst@1972: val now : transaction datetime = phurst@1972: n <- now; phurst@1972: return (fromTime n)