Maybe it has something to do with the famous "Excel data error that isn't"
http://www.joelonsoftware.com/items/2006/06/16.html
date: Thu, 17 Sep 2015 11:56:52 -0500
from: "Englander, Douglas" <Douglas_Englander@xxxxxxxxxxxxx>
subject: RPG date functions vs. Excel date functions
I am reading an excel spreadsheet via RPG (using Scott Klements routines). There is one cell containing the number 40999, which excel interprets as March 31, 2012. The 40999 representing the number of days from January 1, 1900 (January 1, 1900 would be represented as 1).
If I initialize a base date in RPG (a *ISO date field) to December 31, 1899, and add the excel number to it (converted to days), I am expecting to get the date that excel is converting 40999 to (i.e. I would expect RPG to calculate December 31, 1899 + %days(40999) to be March 31, 2012 also). However, no matter how I do it, RPG calculates December 31, 1899 + %days(40999) to be April 1, 2012.
Does anyone have any idea as to why the calculations differ by one day? I trust IBM over Microsoft, and would take the April 1, 2012 date, but I would like to know why the two dates are calculated differently.
Thank you,
Doug
------------------------------
Subject: Digest Footer
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) digest list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
------------------------------
End of RPG400-L Digest, Vol 14, Issue 342
*****************************************
As an Amazon Associate we earn from qualifying purchases.