× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Year 2000 was a leap year.

2000 can be divided by 400, so it is a leap year.


Denis Robitaille
Chef de service TI
Cascades Centre des technologies,
une division de Cascades Canada ULC
412 Marie Victorin
Kingsey falls(Québec) Canada J0A 1B0
T : 819 363 6130


-----Message d'origine-----
De : RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de MichaelQuigley@xxxxxxxxxx
Envoyé : 17 septembre 2015 15:28
À : rpg400-l@xxxxxxxxxxxx
Objet : Re: RPG date functions vs. Excel date functions

Is Excel treating 2000 as a leap year? It wasn't. I know there were problems where Excel didn't properly handle leap years in the past, but I thought this was fixed in more recent versions.

"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 09/17/2015 01:00:02
PM:
----- Message from "Englander, Douglas"
<Douglas_Englander@xxxxxxxxxxxxx> on Thu, 17 Sep 2015 11:56:52 -0500
-----

To:

"rpg400-l@xxxxxxxxxxxx" <rpg400-l@xxxxxxxxxxxx>

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

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing 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.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.