Skip to content

Commit

Permalink
Fixed issue #8125: Wrong SPSS date format for date question results
Browse files Browse the repository at this point in the history
Dev: All date/time question results are exported as a
Dev: full timestamp (yyyy-mm-dd hh:mm:ss).
Dev: May add differential treatment of dates/times/datetimes
Dev: (SPSS: SDATE vs. TIMEw vs. DATEw, etc...)
  • Loading branch information
mfaber committed Jan 20, 2014
1 parent cd20190 commit 9a0923f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/helpers/export_helper.php
Expand Up @@ -124,7 +124,7 @@ function SPSSExportData ($iSurveyID, $iLength, $na = '', $q='\'', $header=FALSE)
if (isset($row[$fieldno]))
{
list( $year, $month, $day, $hour, $minute, $second ) = preg_split( '([^0-9])', $row[$fieldno] );
if ($year != '' && (int)$year >= 1970)
if ($year != '' && (int)$year >= 1900)
{
echo $q.date('d-m-Y H:i:s', mktime( $hour, $minute, $second, $month, $day, $year ) ).$q;
} else
Expand Down Expand Up @@ -341,7 +341,7 @@ function SPSSFieldMap($iSurveyID, $prefix = 'V') {
'E'=>Array('name'=>'Array (Increase, Same, Decrease)','size'=>1,'SPSStype'=>'F','Scale'=>2),
'C'=>Array('name'=>'Array (Yes/No/Uncertain)','size'=>1,'SPSStype'=>'F'),
'X'=>Array('name'=>'Boilerplate Question','size'=>1,'SPSStype'=>'A','hide'=>1),
'D'=>Array('name'=>'Date','size'=>10,'SPSStype'=>'SDATE'),
'D'=>Array('name'=>'Date','size'=>20,'SPSStype'=>'DATETIME23.2'),
'G'=>Array('name'=>'Gender','size'=>1,'SPSStype'=>'F'),
'U'=>Array('name'=>'Huge Free Text','size'=>1,'SPSStype'=>'A'),
'I'=>Array('name'=>'Language Switch','size'=>1,'SPSStype'=>'A'),
Expand Down

0 comments on commit 9a0923f

Please sign in to comment.