1(* 2 Title: Rebuild the basis library: Date 3 Copyright David C.J. Matthews 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 19(* Date . *) 20useBasis "DateSignature"; 21structure Date: DATE = 22struct 23 open Date 24 val date = 25 fn { year, month, day, hour, minute, second, offset } => 26 date {year=FixedInt.fromLarge year, month=month, day=FixedInt.fromLarge day, 27 hour=FixedInt.fromLarge hour, minute=FixedInt.fromLarge minute, 28 second=FixedInt.fromLarge second, offset=offset} 29 val year = FixedInt.toLarge o year 30 and day = FixedInt.toLarge o day 31 and hour = FixedInt.toLarge o hour 32 and minute = FixedInt.toLarge o minute 33 and second = FixedInt.toLarge o second 34 and yearDay = FixedInt.toLarge o yearDay 35end; 36