Skip to content
This repository has been archived by the owner on Nov 12, 2019. It is now read-only.

Commit

Permalink
Resolves error: datetime.datetime(...) is not JSON serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
russfeld committed Jun 4, 2019
1 parent 266d080 commit c7db406
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/google_spreadsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def login_open_sheet(oauth_key_file, spreadsheet):

# Append the data in the spreadsheet, including a timestamp
try:
worksheet.append_row((datetime.datetime.now(), temp, humidity))
worksheet.append_row((datetime.datetime.now().isoformat(), temp, humidity))
except:
# Error appending data, most likely because credentials are stale.
# Null out the worksheet so a login is performed at the top of the loop.
Expand Down

0 comments on commit c7db406

Please sign in to comment.