Limitations in support for Dates

Sometimes Foswiki parses dates in order to convert them to numbers for comparison. Occasionally you might see a date that is displayed "wrong" i.e. the date that Foswiki outputs is not the date you thought you had put in!

This is due to limitations in the support for dates; speicifcally, for dates in the years between 1901 and 1959.

The gory detail. Foswiki follows the conventions implemented by recent releases of perl:

  • Correct date handling requires perl 5.12.4 or newer
    • Versions earlier than 5.12.4 use the underlying OS date routines and may vary by platform
    • Dates before 1900 are generally not supported on older implementations.
  • When displaying a character date from the unix epoch, negative epochs are fully supported.
  • When entering dates, 4-digit dates (years > 999) are treated as the year as written.
  • Years 100-999 are treated as an offset from 1900.
    • 110 = 2010. 112 = 2014.
  • 2-digit years are treated as the "rolling century" for the current year +- 50 years.
    • For the current year, 2014:
      • 63-14 look backwards - 1963-2014
      • 13-62 look forwards - 2013-2062

The simple version: avoid using dates between 1901 and 1959 in a context where the date will be processed by Foswiki.

-- CrawfordCurrie, GeorgeClark - 10 Mar 2014

Support.FAQForm edit

TopicClassification FrequentlyAskedQuestion
Subject Internationalisation or Localisation
Topic Summary Dates between 1901 and 1951 don't work correctly
Interested Parties
Related Topics
Topic revision: r1 - 10 Mar 2014, CrawfordCurrie - This page was cached on 08 Apr 2017 - 04:10.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License