Page 1 of 1

Date field not being recognized on CSV upload

Posted: 2019-07-15 18:48
by nycwebmaster
Hi,

I have one table that one field is called event date, the field type is setup as date, when I try to upload other events thru the csv utilty to upload in appgini it doesn't upload the event dates for the rest of the events even though that is able to upload the rest of the fields even the time fields correctly. I'm positive that I'm using the correct format as I am downloading first the table as a CSV from appgini to make sure that it recognize the CSV format. I also have the "use 24 hr time format" unchecked on the appgini defaults.

When I went to PHPMyAdmin the date field is changed to: 0000-00-00

Can anyone please tell me why the event date is the only field that is not uploading and the rest of the fields are uploaded correctly?

Re: Date field not being recognized on CSV upload

Posted: 2019-07-16 14:18
by nycwebmaster
Solved:

The problem is that when you download from the csv the date format is for example 07/19/2019
before you upload it you have to change it to 2019/0/19

That way the date format is recognized

Re: Date field not being recognized on CSV upload

Posted: 2019-07-16 14:28
by nycwebmaster
BTW the same goes for the time, you have to change it to 24 hour format before to import it with the utility so it shows the correct time format.

Re: Date field not being recognized on CSV upload

Posted: 2020-07-06 09:38
by tchandra
Here's how to change a bunch of CSV files in a directory.

I use JREPL utility to change all csv date to mysql format :
read the documentation here https://www.dostips.com/forum/viewtopic.php?t=6044

download JREPL here https://www.dostips.com/forum/download/ ... ea8a90432c

then create a batch file ie. CHANGEDATE.BAT with regex below and put in the same directory with csv files.

you have to allow Windows Script

Code: Select all


for %%F in (*.csv) do (
                        call jrepl "([0-3][0-9])-([0-1][0-9])-([1-2][0-9][0-9][0-9])" "$3-$2-$1" /f "%%F" /o -
                        )