View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
08684Bug reportsExpression Managerpublic2014-02-12 21:20
Reporterjleimgruber Assigned Tomfaber  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary08684: Possible 2038 unixtime bug in Date/Time's advanced "Minimum date" or "Maximum date" fields.
Description

Survey questions of type Date/Time question that have advanced setting "Minimum date" or "Maximum date" specified with the year 2038 (specifically after 03:14:08 UTC on 19 January 2038) cause problems during validation (the field is always invalid regardless of the date entered).

Steps To Reproduce

Create a survey with a Date/Time question. Select advanced features and for "Maximum date" specify the year 2038 or greater. Test the question and it will not validate, even though the logic checker says it is okay.

Additional Information

This validation field works fine after I put in a maximum date of 2037:
(VALIDATION: ((Retirement Date.NAOK >= '2013-01-01 00:00') and (is_empty('2037-12-31 23:59') || (Retirement Date.NAOK <= '2037-12-31 23:59'))))

This validation field does not work after I put in a maximum date of 2038:
(VALIDATION: ((Retirement Date.NAOK >= '2013-01-01 00:00') and (is_empty(2038) || (Retirement Date.NAOK <= 2038))))

TagsNo tags attached.
Attached Files
Bug heat8
Complete LimeSurvey version number (& build)564691d9a0c134b069bf6e9eb167
I will donate to the project if issue is resolvedNo
Browser"Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130917 Firefox/17.0 Iceweasel/17.0.9"
Database type & versionmysql Ver 14.14 Distrib 5.5.22, for debian-linux-gnu (x86_64) using readline 6.2
Server OS (if known)Ubuntu 12.04 LTS Linux Kernel 3.12.6-x86_64-SMP-linode inside LXC container w/ Docker version 0.7.6, build bc3b2ec
Webserver software & version (if known)Apache/2.2.22 (Ubuntu)
PHP VersionPHP Version 5.3.10-1ubuntu3

Users monitoring this issue

There are no users monitoring this issue.

Activities

mfaber

mfaber

2014-02-07 21:48

reporter   ~28565

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=13861

mfaber

mfaber

2014-02-07 21:52

reporter   ~28567

Maxdate validation should now work up to year 2099. Not guaranteed to work for date formats containing two digit years ;).

jleimgruber

jleimgruber

2014-02-07 22:28

reporter   ~28568

I just tested it and now it accepts my dates properly! Should be good for a few more years now! ;p

Thanks for the quick response!

DenisChenu

DenisChenu

2014-02-08 15:54

developer   ~28578

@mfaber : we can not ask historical date here. It's really just to undersant: why not accept date after 2038 why not accept date after 2099 or before 1901 ?

I first understand the date betwwen 1901 and 2038 for historical purpose, here i don't track if we use DATETIME for mysql.
But i think we use PHP 5.3 and we can have date in 64b
http://en.wikipedia.org/wiki/Year_2038_problem#Solutions

mfaber

mfaber

2014-02-08 16:09

reporter   ~28580

Denis: I initially limited the range to 1900-2038 because it just did not work with dates beyond that (32bit problem)?. Can't remember which component made the trouble. Probably the date picker or the phpjs functions. I was quite surprised yesterday to find min/maxdate working with dates > 2038.

Kept the dropbox style date question at 2038 because the year dropbox would just get too full.
Otherwise I'd be okay with setting limits from 1700-2200 or something else if you think it's useful. Just need to be prepared for crazy things to happen :).

mfaber

mfaber

2014-02-08 16:22

reporter   ~28583

Denis: regarding mysql: reponses to date/time question are saved as a string...so there should be no problem from the DB side.

DenisChenu

DenisChenu

2014-02-08 19:14

developer   ~28585

Hi,

No , leave it for 2.1 :) or just an $config

c_schmitz

c_schmitz

2014-02-12 21:20

administrator   ~28680

2.05+ Build 140212 released

Related Changesets

LimeSurvey: master 72e4aed7

2014-02-07 21:46

mfaber

Committer: mfaber


Details Diff
Fixed issue 08684: Allow maxdate > year 2038

Dev: leave default max at 2038 (eg. contents of
Dev: dropdown boxes). Allow up to 2099 if
Dev: maxdate is set accordingly.
Affected Issues
08684
mod - application/helpers/expressions/em_manager_helper.php Diff File
mod - application/helpers/qanda_helper.php Diff File

Issue History

Date Modified Username Field Change
2014-02-07 19:11 jleimgruber New Issue
2014-02-07 19:11 jleimgruber File Added: limesurvey_question_10597.lsq
2014-02-07 20:04 c_schmitz Assigned To => mfaber
2014-02-07 20:04 c_schmitz Status new => assigned
2014-02-07 21:48 mfaber Changeset attached => LimeSurvey master 72e4aed7
2014-02-07 21:48 mfaber Note Added: 28565
2014-02-07 21:48 mfaber Resolution open => fixed
2014-02-07 21:52 mfaber Note Added: 28567
2014-02-07 21:52 mfaber Status assigned => resolved
2014-02-07 21:52 mfaber Fixed in Version => 2.05+
2014-02-07 22:28 jleimgruber Note Added: 28568
2014-02-08 15:54 DenisChenu Note Added: 28578
2014-02-08 16:09 mfaber Note Added: 28580
2014-02-08 16:22 mfaber Note Added: 28583
2014-02-08 19:14 DenisChenu Note Added: 28585
2014-02-12 21:20 c_schmitz Note Added: 28680
2014-02-12 21:20 c_schmitz Status resolved => closed