Date question with CSV export

  • Posts: 3
  • Thank you received: 0
12 years 2 months ago #41688

I searched the forum and could not find an answer to this problem I am seeing.

When I export orders from the sales screen, the order_created and order_modified fields do not display as a date in Excel 2007. When I attempt to apply the date format I get all "#" displayed in the Excel cell.

However, registerdate and lastvisit date display fine in excel.

I am using 1.5.6 starter with Joomla 2.5.1, and the default semicolon as the delimeter for the CSV file.

Can someone please help with this?

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
12 years 1 month ago #41836

Could you please point me in the right direction to understand these dates? I want to upgrade to the business version but I need to know I can get the right data to download to quickbooks... Thanks in advance...

Please Log in or Create an account to join the conversation.

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
12 years 1 month ago #41860

Hi,

These fields use the unix timestamp format which is not understood by excel as a date.
If you want to change that, you need to edit the file "export" of the view "order" of your back end template via the menu Display->Views and add the code:

if(in_array($key,array('order_created','order_modified'))){
 $val=hikashop_getDate($val);
}
before the code:
echo '"'.str_replace('"','""',$val).'"';
Then, when you export, you should get dates properly displayed by excel.

The following user(s) said Thank You: mbolton01

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
12 years 1 month ago #41863

Thank you, I will try this today...

Works great - Thank you very much...

Last edit: 12 years 1 month ago by mbolton01.

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 0
12 years 1 month ago #42586

Nicolas,

I'm experiencing the same issue with the dates when exporting sales as CSV.
I tried to add the code you provided, but I can not get it to work.
I still get the ### when formatting as date in excel.

Could you please post an example of the original code, WITH the added code inside,
so I can see exactly where it goes?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
12 years 1 month ago #42721

If you don't see any difference, it's probably that you edited the file for the wrong template. Make sure that you do it for your back end template and it will work.

Please Log in or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum