Skip to content

ValueError: time data '1/20/14' does not match format '%m/%d/%Y' #5

@HeQYT

Description

@HeQYT

Hello:
when I run(win8.1 64bit, Spyder 3.2.4, MySQL 5.7.20):
E:>python 4db_mysql_load_from_csv.py supplier_data.csv
it said: "ValueError: time data '1/20/14' does not match format '%m/%d/%Y'", but I changed "str(row[column_index]), '%m/%d/%Y'))" into "str('1/20/2015'), '%m/%d/%Y')) ", it can run , and the result is 👍
+---------------+----------------+-------------+------+---------------+
| Supplier_Name | Invoice_Number | Part_Number | Cost | Purchase_Date |
+---------------+----------------+-------------+------+---------------+
| Supplier X | 001-1001 | 2341 | 500 | 2015-01-20 |
| Supplier X | 001-1001 | 2341 | 500 | 2015-01-20 |
| Supplier X | 001-1001 | 5467 | 750 | 2015-01-20 |
| Supplier X | 001-1001 | 5467 | 750 | 2015-01-20 |
| Supplier Y | 50-9501 | 7009 | 250 | 2015-01-20 |
| Supplier Y | 50-9501 | 7009 | 250 | 2015-01-20 |
| Supplier Y | 50-9505 | 6650 | 125 | 2015-01-20 |
| Supplier Y | 50-9505 | 6650 | 125 | 2015-01-20 |
| Supplier Z | 920-4803 | 3321 | 615 | 2015-01-20 |
| Supplier Z | 920-4804 | 3321 | 615 | 2015-01-20 |
| Supplier Z | 920-4805 | 3321 | 615 | 2015-01-20 |
| Supplier Z | 920-4806 | 3321 | 615 | 2015-01-20 |
+---------------+----------------+-------------+------+---------------+
what's the matter? thanks.

sd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions