Skip to content

Commit

Permalink
convert dates to RFC3339
Browse files Browse the repository at this point in the history
  • Loading branch information
7yl4r authored Jun 10, 2024
1 parent 3ead4cf commit 8817ca9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nerrs_data/getData.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ def getData(station_code, param_name):

# Convert the extracted data into a pandas DataFrame
df = pd.DataFrame(data_rows, columns=['DateTimeStamp', 'Sal'])


# Convert the 'date' column to datetime format
df['DateTimeStamp'] = pd.to_datetime(df['DateTimeStamp'], format='%m/%d/%Y')

# Convert to RFC3339 format
df['DateTimeStamp'] = df['DateTimeStamp'].dt.strftime('%Y-%m-%dT%H:%M:%SZ')

return df


Expand Down

0 comments on commit 8817ca9

Please sign in to comment.