콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4 답글
15748 화면

17-12-2015 7:05' does not seem to be a valid date for field 'Order Date' 

at row 2 

Use the format '2012-12-31'     -- >  while i was use field.Date

and

'17-12-2015 7:05' does not seem to be a valid datetime for field 'Order Date' 

at row 2

Use the format '2012-12-31 23:59:59'  -- >  while i was use field.Datetime


how i can upload dd/mm/yyyy / H/M format   from CSV file
my actual date like that 

17-12-2015 8:38

아바타
취소
베스트 답변

CSV import expects dates in a specific format - and it tells you this - they need to be in the format "2012-12-31 23:59:59".

Unless you can change the format of the date fields in your files, you can't import them via CSV.


Krupesh is advising either to run a script, or to use Excel/Open Office to change the format of the field into the correct format.

아바타
취소
베스트 답변

write one script in python and create new csv file for the date format:

suppose you have customer csv open it using below code and format date as per requirement I had split the date with . (dot) you have to format the code as per your requirement.

from new csv file copy whole column to the original csv file you get the formatted date as per requirement.

import csv

csv_rd = csv.reader(open("customer"+".csv"), delimiter=';')

count = 0

for rec in csv_rd:

fields = rec

break

all_datas = []

for rec in csv_rd:

all_datas.append(rec)

a = []

for rec in all_datas:

print rec[7]

print rec[7].split('.')

s = rec[7].split('.')[2] + '-' + rec[7].split('.')[1] + '-' + rec[7].split('.')[0]

print s

a.append(s)

with open('eggs.csv', 'wb') as csvfile:

spamwriter = csv.writer(

csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)

for val in a:

spamwriter.writerow([val])

아바타
취소
작성자

@krupesh is this every time task or a single time task ? bcoz i want daily upload 5-10 file with more the 2000 record in every file ... every time i(we) can't upload multiple time file like first change the date and then after upload in main place can you know about any date field which can directly convert date in dd-mm-yyyy h-m format without upload another place upload file

Please try do it from property of the column you can change property of the column may be this is help full to you.

관련 게시물 답글 화면 활동
2
1월 24
1740
2
6월 22
3568
1
10월 21
2799
3
6월 20
2794
1
11월 18
8250