hey guys,
im new to python and i am working on creating an automated script to run at certain times of the day. basically i am passing a unix timestamp to a query. the script works 100% of the time when i run it from pycharm on my desktop or when i run it from the pythonanywhere editor, or in the bash consoles in pythonanywhere. however, when i set the script to run as an automated task, it throws an error and does not run at all. this is the code i am using and this is the error i get: if someone could help me correct my mistake in order to automate my tasks, it would be extremely appreciated!!
this is my import statement used:
from datetime import datetime
timestamp_today = datetime.today().timestamp()
and the error i get:
File "/home/somesite/dir/fetchstuff.py", line 84, in fetch
timestamp_today = datetime.today().timestamp() AttributeError: 'datetime.datetime' object has no attribute 'timestamp'
2017-12-19 02:31:18 -- Completed task, took 33.00 seconds, return code was 1.
[edited by admin: formatting]