Home My Page Projects Code Snippets Project Openings SML/NJ Bugs
Summary Activity Tracker Lists

[#139] Date.date is broken

Date:
2015-09-01 14:11
Priority:
3
State:
Closed
Submitted by:
Bug Submitter (webuser)
Assigned to:
John Reppy (jhr)
Machine Architecture:
None
Operating System:
Generic Unix
Component:
Basis Library
Resolution:
Fixed
Severity:
Major
OS Version:
SML/NJ Version:
110.78
Keywords:
Dates
URL:
Transcript (of reproduction):
Standard ML of New Jersey v110.78 [built: Sun Dec 21 16:30:08 2014] - fun mkdate (y,mo,d,h,mi,s) = Date.date { = year=y, month=mo, day=d, hour=h, minute=mi, second=s, = offset = NONE = }; - Date.weekDay(mkdate(1900, Date.Feb, 28, 1, 2, 3)) (* should be Wed *); val it = Mon : Date.weekday - Date.yearDay(mkdate(1900, Date.Feb, 28, 1, 2, 3)); (* should be 58 *) val it = 0 : int -
Source (for reproduction):
fun mkdate (y,mo,d,h,mi,s) = Date.date { year=y, month=mo, day=d, hour=h, minute=mi, second=s, offset = NONE }; Date.weekDay(mkdate(1900, Date.Feb, 28, 1, 2, 3)); (* should be Wed *) Date.yearDay(mkdate(1900, Date.Feb, 28, 1, 2, 3)); (* should be 58 *)
Summary:
Date.date is broken

Detailed description
The creation of Date values using the Date.date
function sometimes produces incorrect dates.
Additional comments:
The correct behavior was verified with both mosml and mlton

Submitted via web form by John Reppy <jhr@cs.uchicago.edu>

Comments:

Message  ↓
Date: 2015-09-28 15:42
Sender: John Reppy

Fixed for 110.79.

Attached Files:

Changes

Field Old Value Date By
status_idOpen2015-09-28 15:42jhr
close_dateNone2015-09-28 15:42jhr
ResolutionNone2015-09-28 15:42jhr
assigned_tonone2015-09-01 14:12jhr
detailsThe creation of Date values using the Date.date function sometimes produces incorrect dates. Additional comments: The correct behavior was verified with both mosml and mlton Submitted via web form by John Reppy <jhr@cs.uchicago.edu> 2015-09-01 14:12jhr
Transcript (of reproduction)Standard ML of New Jersey v110.78 [built: Sun Dec 21 16:30:08 2014] - fun mkdate (y,mo,d,h,mi,s) = Date.date { = year=y, month=mo, day=d, hour=h, minute=mi, second=s, = offset = NONE = }; - Date.weekDay(mkdate(1900, Date.Feb, 28, 1, 2, 3)) (* should be Wed *); val it = Mon : Date.weekday - Date.yearDay(mkdate(1900, Date.Feb, 28, 1, 2, 3)); (* should be 58 *) val it = 0 : int -2015-09-01 14:12jhr
Source (for reproduction)fun mkdate (y,mo,d,h,mi,s) = Date.date { year=y, month=mo, day=d, hour=h, minute=mi, second=s, offset = NONE }; Date.weekDay(mkdate(1900, Date.Feb, 28, 1, 2, 3)); (* should be Wed *) Date.yearDay(mkdate(1900, Date.Feb, 28, 1, 2, 3)); (* should be 58 *) 2015-09-01 14:12jhr