Alternate Accounting Period for Reports

Edward Doolittle edward.doolittle at gmail.com
Sun Jan 18 11:53:08 EST 2015


YYYYMMDD or YYYY-MM-DD are ISO 8601 date formats, not Julian dates.

"The *Julian Day Number* (*JDN*) is the integer assigned to a whole solar
day in the Julian day count starting from noon Greenwich Mean Time
<http://en.wikipedia.org/wiki/Greenwich_Mean_Time>, with Julian day number
0 assigned to the day starting at noon on January 1, 4713 BC
<http://en.wikipedia.org/wiki/4713_BC>, proleptic Julian calendar
<http://en.wikipedia.org/wiki/Proleptic_Julian_calendar>." (
http://en.wikipedia.org/wiki/Julian_day)

The year 4713 BC was chosen because it (presumably) pre-dates any
historical date. Any positive integer could be a Julian day number, whereas
something like 20151432 could not be an ISO 8601 date.

Julian dates are not commonly used in popular culture, so as users of
GnuCash most of us don't have to concern ourselves with the system. Julian
dates are used mainly by astronomers, and by computer programmers as a
useful intermediate format in date conversion calculations. (Instead of
needing n^2-n date conversion algorithms, one only needs 2n-2 algorithms if
Julian dates are always used as an intermediate format.)

(I have also heard that Julian dates are sometimes used to obscure the
packing date of food items so that customers won't dig out the freshest
item from the grocery store refrigerator, but I've never seen that first
hand and it seems kind of pointless in any region where there are
government-mandated "best before" dates. I'm sure most large scale food
packers encode the date/time of packing somehow, but I would be quite
surprised to find one that used full-on Julian dates.)

I wouldn't underestimate the difficulty of correctly counting the number of
days between two dates, even in ISO format. The least error-prone way I can
think of is to convert ISO dates into Julian dates (or some variation
thereof) using a standard function and take the difference. For example,
spreadsheets use a variation of Julian dates internally, so to find the
number of days between two dates you can just subtract the cells containing
the dates. (But even that can lead to errors with dates that are near the
year 1900 for bizarre historical reasons.)

ISO 8601 dates also sort alphabetically, which makes them very useful for
file names. I use ISO 8601 dates wherever possible for my own personal use,
e.g., in GnuCash, because I find them faster to read, easier to sort (most
significant to least significant, like numbers), and less error-prone to
use. As usual, YMMV.

I have never heard of day/month/year as an ISO standard ... can someone
point me to a standards document?

On 18 January 2015 at 09:40, Mike or Penny Novack <stepbystepfarm at mtdata.com
> wrote:

>
>  While I might agree, and the ISO agrees with you and me as well (there
>>> are two ISO standards - day/month/year and year/month/day), it happens that
>>> pretty much the entire USA uses the Month-Day-Year format, probably because
>>> it translates directly from the way they prefer to say/write dates in
>>> words: January 18, 2015.
>>>
>>> And getting the entire USA to switch that, would probably be harder than
>>> getting them to go metric.
>>>
>> Actually, use of Julian date (yyyymmdd) is rather common in programming,
> at least internally. The point is that makes the dates ordered (simple to
> sort as numbers rather than a multiple field sort). And it isn't very
> difficult to have a "output edit" routine to convert the Julian dates to
> what the users expect to see in report outputs. Nor is the function that
> will return the difference (how many days) between two Julian dates all
> that complicated.
>
> Michael D Novack
>
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>



-- 
Edward Doolittle
Associate Professor of Mathematics
First Nations University of Canada
1 First Nations Way, Regina SK S4S 7K2

« Toutes les fois que je donne une place vacante, je fais cent mécontents
et un ingrat. »
-- Louis XIV, dans Voltaire, Le Siècle de Louis XIV, Chap. XXVI


More information about the gnucash-user mailing list