From: James J. Gavan on 6 Feb 2010 15:54 I have a COBOL method to get the Day of Any Week (after the year 1601), regardless of date input format, which can be any of the following, and includes spoken language as a parameter :- - Current-Date = ISO-8 (ISO-8 is of course Gregorian) - ISO-8 ccyymmdd - ISO-6 yymmdd - EU-8 ddmmccyy - EU-6 ddmmyy - NA-8 mmddccyy - NA-6 mmddyy Seems to work OK for 8-digit dates. I'm a bit dubious about 6-digit dates. Without going into specifics, take a 6-digit date for centuries 1600, 1700, 1800 - it might just fail - I wont know until I have tested the feature thoroughly. As I say it seems to work OK with 8-digit dates. With that I can get the Day of Week for the Boston Tea Party. However I scribbled something down I found on the Web, "During part of the period 1700 - 1799 The Julian calendar was still used by Britain and its colonies". So here's the problem - what actually was the Day of Week for the Boston Tea Party, - I'm not after a formula but confirmation from one of you 'colonials' as to the correct day of week for 12161773 or Dec 16 1773. I came up with a day of 'Thursday' Jimmy, Calgary AB
From: Richard on 6 Feb 2010 17:13 On Feb 7, 9:54 am, "James J. Gavan" <jgavandeletet...(a)shaw.ca> wrote: > I have a COBOL method to get the Day of Any Week (after the year 1601), > regardless of date input format, which can be any of the following, and > includes spoken language as a parameter :- > > - Current-Date = ISO-8 (ISO-8 is of course Gregorian) > - ISO-8 ccyymmdd > - ISO-6 yymmdd > - EU-8 ddmmccyy > - EU-6 ddmmyy > - NA-8 mmddccyy > - NA-6 mmddyy > > Seems to work OK for 8-digit dates. I'm a bit dubious about 6-digit > dates. Without going into specifics, take a 6-digit date for centuries > 1600, 1700, 1800 - it might just fail - I wont know until I have tested > the feature thoroughly. > > As I say it seems to work OK with 8-digit dates. With that I can get the > Day of Week for the Boston Tea Party. However I scribbled something down > I found on the Web, "During part of the period 1700 - 1799 The Julian > calendar was still used by Britain and its colonies". So here's the > problem - what actually was the Day of Week for the Boston Tea Party, - > I'm not after a formula but confirmation from one of you 'colonials' as > to the correct day of week for 12161773 or Dec 16 1773. > > I came up with a day of 'Thursday' > > Jimmy, Calgary AB """Britain and her colonies (including what is now the United States), did not switch to the Gregorian calendar until 1752, when Wednesday 2nd September in the Julian calendar dawned as Thursday the 14th in the Gregorian.""" As 1773 is after 1752 then it should be the correct day of the Gregorian.
From: Pete Dashwood on 6 Feb 2010 19:15 James J. Gavan wrote: > I have a COBOL method to get the Day of Any Week (after the year > 1601), regardless of date input format, which can be any of the > following, and includes spoken language as a parameter :- > > - Current-Date = ISO-8 (ISO-8 is of course Gregorian) > - ISO-8 ccyymmdd > - ISO-6 yymmdd > - EU-8 ddmmccyy > - EU-6 ddmmyy > - NA-8 mmddccyy > - NA-6 mmddyy > > Seems to work OK for 8-digit dates. I'm a bit dubious about 6-digit > dates. Without going into specifics, take a 6-digit date for > centuries 1600, 1700, 1800 - it might just fail - I wont know until I > have tested the feature thoroughly. > > As I say it seems to work OK with 8-digit dates. With that I can get > the Day of Week for the Boston Tea Party. However I scribbled > something down I found on the Web, "During part of the period 1700 - > 1799 The Julian calendar was still used by Britain and its colonies". > So here's the problem - what actually was the Day of Week for the > Boston Tea Party, - I'm not after a formula but confirmation from one > of you 'colonials' as to the correct day of week for 12161773 or Dec > 16 1773. > I came up with a day of 'Thursday' > > Jimmy, Calgary AB I tried it on several online calculators and they all agreed it was Thursday :-) Pete. -- "I used to write COBOL...now I can do anything."
From: Tony Harding on 6 Feb 2010 23:54 On 02/06/10 15:54, James J. Gavan wrote: > I have a COBOL method to get the Day of Any Week (after the year 1601), > regardless of date input format, which can be any of the following, and > includes spoken language as a parameter :- > > - Current-Date = ISO-8 (ISO-8 is of course Gregorian) > - ISO-8 ccyymmdd > - ISO-6 yymmdd > - EU-8 ddmmccyy > - EU-6 ddmmyy > - NA-8 mmddccyy > - NA-6 mmddyy > > Seems to work OK for 8-digit dates. I'm a bit dubious about 6-digit > dates. Without going into specifics, take a 6-digit date for centuries > 1600, 1700, 1800 - it might just fail - I wont know until I have tested > the feature thoroughly. > > As I say it seems to work OK with 8-digit dates. With that I can get the > Day of Week for the Boston Tea Party. However I scribbled something down > I found on the Web, "During part of the period 1700 - 1799 The Julian > calendar was still used by Britain and its colonies". So here's the > problem - what actually was the Day of Week for the Boston Tea Party, - > I'm not after a formula but confirmation from one of you 'colonials' as > to the correct day of week for 12161773 or Dec 16 1773. > > I came up with a day of 'Thursday' > > Jimmy, Calgary AB Correct, Jimmy, 12/16/1773 was a Thursday, the 350th day of 1773.
From: James J. Gavan on 7 Feb 2010 13:53
Tony Harding wrote: > On 02/06/10 15:54, James J. Gavan wrote: > > Correct, Jimmy, 12/16/1773 was a Thursday, the 350th day of 1773. > Thanks for that; I can see you obviously got into Julian dates for the '350' :-). Hang about a bit; without checking back on the text, one of the COBOL date functions might do it. (But that's not important - see below). As background - I read, and read up on the ACCEPT FROM xxxx and the Date Functions, and moseyed around the Web looking for COBOL examples. And I initially started coding for each of the ACCEPTs and Functions. To hell with that. The objective is to give developers an easy way into 'Dates' with methods like "DateBackwardsOrForwards", or "DifferenceBetweenDates". Yes, the class is Parameter based, some 7 changeable options. Essentially you provide an input date(s) where necessary with which spoken language you want to use - resulting in Day and Month names in required language. Obviously the two methods quoted DO use the Date functions. But providing my coding and tests are accurate, unless you are a masochist, you really don't need to become an expert on Dates ! (For the curious, the source of DateAndTime, the parent class, will be available). Jimmy, Calgary AB PS: How I hate spellcheckers which obscure the typo you made. Same goes with Messaqeboxes. I asked M/F years ago if you could move a mesagebox. The reply was 'No'. Just about a month ago checked the methods for their class Messagebox. Lo and behold "setmoveable". Just checked the Mozilla Thunderbird I'm using - I can drag their SpellChecker Dialog around the screen ! Jimmy, Calgary AB |