Hello Thomas,

I strongly suggest to use the standard SQL date/time format. Not only we do generally not need time zone information but you will also not need to convert any responses handled inside the session.

If you look at getDateFormatData in /classes/core surveytranslator you will find many different date time formats and their equivalent representation in javascript (for jQuery UI Datepicker) and PHP.

Using /classes/datetimeconverter/class.datetimeconverter.php you will be able to convert from any of these formats to any other in PHP

Afaik the jquery date widget always gives back the same format.

Please remember that the date question type has been extended in limesurvey_dev to be even more flexible.


Best regards from Hamburg/Germany

Carsten Schmitz

LimeSurvey Project Leader
carsten.schmitz@limesurvey.org

http://www.limesurvey.org




Am 08.08.2011 22:07, schrieb Thomas White, MD, MS, MA:
All-

I'm trying to add support for Date and  Time datatypes, and functions that use them, within ExpressionManager.

JavaScript's native support for Date is quite limited. PHP is better, but uses quite different formatting strings from Java (which is what I'm most used to).

Since there is no native DateTime object in JavaScript , the most logical choice for a universal DateTime format seems to be ISO 8601 (like 2008-11-01T20:39:57.78-06:00).  Has the LimeSurvey team been planning towards a different DateTime standard?

JavaScript version 5 is supposed to have native support for ISO 8601, but most current browsers won't support it right now. I've seen several JavaScript and PHP libraries/functions for parsing and printing dates in ISO 8601 (and other) formats, but the most popular ones are not well maintained.  jQuery has a date picker API that seems to  support Java-formatted strings (and has a nice GUI), but doesn't parse/format dates as part of its API.

So, questions for the LimeSurvey team:
(1) Do you already use  or recommend particular Date/Time parsing/formatting functions (in JavaScript and PHP)
(2) Any objections to using ISO 8601 as an internal Date/Time standard (e.g. so can store it in that format in the database, but as a String instead of as a DateTime object)?
(3) Any strong preference for PHP vs. Java Date/Time formatting syntax?

/Tom


------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1


_______________________________________________
limesurvey-developers mailing list
limesurvey-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/limesurvey-developers