Issue with date, import csv ?

kouros91

Member
Hi. I've a little problem with csv import.
Import runs perfectly but my date element is not correct.
Date is recorded in the table one day before the date recorded in the csv !
I've changed properties in date element (like utc or local) but it doesn"t changed.

My date element is in format d/m/Y for list and form and format import is in normal list
For exemple a record in csv with date in french 16/06/1966 is after import in the table 15/06/1966.

Is it an real issue or something wrong in my use of farbik ?

Thank you :)

Nicolas
 
Seems to be a bug, not related to the format.
No matter if the date is set to local or UTC Fabrik is subtracting the TZ offset (Joomla TZ set to Zurich = MEZ)
Example:
1st date element = UTC, 2nd = local
Export ids 79-81, re-import the csv file
upload_2017-2-10_15-36-13.png

upload_2017-2-10_15-35-17.png
 
Or I could fix it. :)

I recently changed the date handling on CSV import, so it could handle different date formats, rather than just MySQL format, because changing date formats in Excel (or whatever) is a major pain in the butt. I may well have broken the tz offset handling when I did that.

I'll take a look later today.


Sent from my HTC 10 using Tapatalk
 
Out of interest, did you try setting the "CSv Import Format" for your date element(s), at the bottom of the Date Formats tab?

The label is a little misleading, as it also controls how the TZ is applied. And the options aren't complete yet. basically, it lets you select ...

Input date is in your "List format"
Input date is in your "Form format"
Input date is in MySQL format, and is local time
Input date is in MySQL format, and is in GMT time

The missing ones there is the ability to specify local/gmt if using a non-standard (non MySQL, Y-m-d H:i:s) format.

But if your imported dates are in the standard format, you should be able to control whether we apply a TZ offset to them or not.

So I guess the question is, what is that set to on your dates, and does changing it change anything?

-- hugh
 
My format import csv element is normal (list format) or normal. These two others options makes crash import. For now , i've added a day with listcsv plugin.
Is it possible to mask options csv import in front end ?
 
My date in csv is a birthday date from members. It's just date in french dd/mm/yyyy , not time. Save option of date element is Local Time, but i suppose we don't care cause there's no time , no ?
 
OK, yup, I'd need to add two more options. As per my previous post, we're missing a couple of options. With MySQL format time, we allow you to specify if it's local or GMT. But at the moment, when you specify list or form format, we assume it's in J!'s time zone and you are storing as GMT, so the TZ offset will get applied. I need to split "form format" and "list format" into "form format - GMT" and "form format - local", and "list format" into "list format - GMT" and "list format - local".

Well, really what I should do is split out the GMT / local into a separate option, but that would break backward compat.

Regarding "don't care" about time ... if you don't specify a time, we automatically append 00:00:00.

-- hugh
 
Yes. Or format your CSV inputs in standard MySQL format (YYYY-MM-DD HH:MM:SS) and specify "local time" in that format menu.

I'll try and get round to adding those other options soon, although I can't guarantee when it will happen.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top