Date field not being recognized on CSV upload

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
nycwebmaster
Veteran Member
Posts: 90
Joined: 2015-11-23 01:02

Date field not being recognized on CSV upload

Post by nycwebmaster » 2019-07-15 18:48

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?

nycwebmaster
Veteran Member
Posts: 90
Joined: 2015-11-23 01:02

Re: Date field not being recognized on CSV upload

Post by nycwebmaster » 2019-07-16 14:18

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

nycwebmaster
Veteran Member
Posts: 90
Joined: 2015-11-23 01:02

Re: Date field not being recognized on CSV upload

Post by nycwebmaster » 2019-07-16 14:28

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.

tchandra
Posts: 13
Joined: 2019-09-22 16:52

Re: Date field not being recognized on CSV upload

Post by tchandra » 2020-07-06 09:38

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 -
                        )

Post Reply