ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Php errors on entry date with very old dates

May 01, 2012 10:14pm

Subscribe [2]
  • #1 / May 01, 2012 10:14pm

    PhilBrienesse

    187 posts

    I am working on a site that has a very old historical timeline. If I post entries with old dates in the standard date tab entry date field I get PHP errors several like this

    Message: date() expects parameter 2 to be long, string given
    Filename: api/Api_channel_entries.php
    Line Number: 271

    I am using dates like 1812.

    If I use a date field instead I dont get any errors.

    Any ideas?

  • #2 / May 01, 2012 10:48pm

    PhilBrienesse

    187 posts

    Actually I dont get errors if I use a date field but it doesn’t sort them properly and it doesnt display dates in the 1800 range.

    {exp:channel:entries channel="timeline" dynamic="no" orderby="cf_timelineDate" sort="asc" status="not closed"}

    Sorts out as

    1904, 1905, 1906, 1812, 1822, 1884

    And this code

    <h3 class="timelineTitle"><a href="http://{page_url}" title="{title}">{cf_timelineDate format="%M %Y"}</a></h3>

    Only outputs a date for the 1900’s and not the 1800’s??

  • #3 / May 02, 2012 12:26pm

    Shane Eckert

    7174 posts

    Hello PhilBrienesse,

    I am sorry to hear you are running into this problem.

    What version of ExpressionEngine are you currently using?

    Can you list for me the Add-Ons that you have installed?

    Thank you,

  • #4 / May 02, 2012 6:07pm

    PhilBrienesse

    187 posts

    Sorry should have thought to include that.

    2.4 build 20120123 is the version. Addons are numerous. Biggest ones would be structure, wygwam, channel videos (although not in this channel), seo-lite.

    Cant think of any other plugins that would be affecting the control panel publishing on this channel. I did manage to find a workaround though. An addon called dropdate which gives you drop downs for day, month and then a year range. It has two modes unix time stamp or yyyymmdd. In timestamp mode it has similar issues and basically wont save a date in the 1800 range. In yyyymmdd mode it does work fine.

  • #5 / May 03, 2012 2:42pm

    Shane Eckert

    7174 posts

    Hey PhilBrienesse,

    I am glad you found a work around, though this issue is odd.

    Are all of these Add-Ons up to date?

    Thank you,

  • #6 / May 03, 2012 3:40pm

    PhilBrienesse

    187 posts

    Yes they are all up to date.

    Oddly enough on the configuration instructions for drop date it says this.

    “DropDate can store dates as a UNIX timestamp (the default), or in YYYYMMDD format.

    The latter is included for use with Solspace’s Super Search module, which doesn’t play nicely with UNIX timestamps for dates prior to 1970.”

    So perhaps there is issues with other addons or EE itself not sure, although i had dates before 1970 that worked fine. I dont have supersearch on this site just so there is no confusion there. Dont really want to uninstall structure to see if that is the issue. I’m kinda pressed for time on this site (isn’t that always the way) but perhaps when I am done I will do some testing on a vanilla installation with very old dates and see what happens. Gradually add in my stock addons and see if it is an addon issue. Would be interesting to see if anyone else has had the same issue although I dont imagine its very often people need dates from the 1800’s

  • #7 / May 03, 2012 3:46pm

    Shane Eckert

    7174 posts

    Hi PhilBrienesse,

    Ha! I have yet to need access to dates pre 1900’s. 😊

    Is there anything else I can help you with?

    Cheers,

  • #8 / May 03, 2012 4:56pm

    PhilBrienesse

    187 posts

    Nope all good I will post a reply if I ever get around to testing.  Found this curiousity “32bit Unix time only works from 1970 to 2036”. But like I said I really shouldn’t be delving into the depths of this issue since I have something that works. Thanks for the assistance.

  • #9 / May 03, 2012 4:58pm

    Shane Eckert

    7174 posts

    Hey Phil,

    Sounds good. Thanks for your time my friend.

    Have a good week. Tomorrow is Friday!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases