1

I have created data export view. I need to include a date field in this format: Y-m-d (yyyy-mm-dd). I went to 'Date and Time', then added a new format and assigned it to the short format.

In views, I then select the date field, and select 'short' as the format. The new format (Y-m-d) displays in the view preview correctly.

I download the XLS and open it up, but the date field is defaulting to m/d/y (1/10/13). Why would the date appear correctly in the views preview but not in the download? I also verified all the correct formatters are set in the CCK date field settings. If I just show the fields in a plain old table view layout, it is also displayed correctly. the only incorrect format is in the XLS I download.

Please note: If I change the date field to include a 'From date' & 'To Date' and display both To and From dates in one column, the XLS then displays the dates correctly but unfortunately, I can't have these sets of dates in one column. I need them in 2 columns and in the 'Y-m-d' format.

To further troubleshoot, I also tried selecting the same date field in views and only displaying one date per column. One column to display From and the same date field to display To. This also results in m/d/y (1/10/13).

Is this a bug? I can replicate this on my local environment as well. Basically, the custom date formatters are not being portrayed on the export.

I am using:

  • Linux CentOS
  • PHP 5.3.3
  • MySQL 5.1.61
  • Drupal 6
  • Views 6.x-2.16
  • Views Export 6.x-2.0-beta6
2
  • Please write as answer what is the answer for the question you asked; answer and question should not be mixed up. Probably you cannot immediately write an answer, but you will be able in the next hours.
    – apaderno
    Jul 14, 2013 at 16:56
  • Have you tried downloading the file in a different format instead of .xls? It's very possible that Excel or OpenOffice (or whichever program you use to open the spreadsheet) is automatically changing the format of the dates displayed.
    – jerdiggity
    Jul 14, 2013 at 20:46

1 Answer 1

1

The date format was being set via the Operating System. OS X's default language and text preferences was re-formatting all dates I type.

With OS X 10.8.3 the preferences are on "System Preferences >> Language and Text >> Region >> Dates >> Customize." There, you can enter your preferred date format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.