Hi,
I got a CSV file with a column named Time that contains a DateTime format like this one:
4/25/2016 09:30:00 PM
All the cells contains data like this
SQL doesn’t recognize this kind of format
I would like:
-
Import the data in the right format
-
Separate Date form Time in two separate cells
-
Replace the old Time column with the the new correct ones
Hi @FedericoM ,
Welcome to Google Cloud Community!
- SQL can’t directly convert your datetime format: While SQL doesn’t handle AM/PM directly, Python’s pandas library can.
- Use Python’s pandas to manipulate data: Read your CSV into a pandas DataFrame, parse the datetime with format, and separate date and time into separate columns.
- Save the modified DataFrame: Save the DataFrame with new columns to a new CSV file.
This approach provides a flexible solution for working with your specific datetime format and preparing data for further processing in SQL or other tools.