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 = 2012.
  • 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

Extended date-time support now is available via DateManipPlugin, i.e. far broader coverage of all kinds of date and time formats in various languages, parsing and formating. It also comes with support for durations and recurrences, as well as business days arithmetics.

-- Main.MichaelDaum - 07 Nov 2018

Support.FAQForm edit

TopicClassification FrequentlyAskedQuestion
Subject Internationalisation or Localisation
Topic Summary Dates between 1901 and 1951 don't work correctly
Extension
Interested Parties
Related Topics
Topic revision: r3 - 07 Nov 2018, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy