Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'datetime.datetime' object has no attribute 'timestamp' #9

Open
greenlee opened this issue Jun 8, 2020 · 1 comment

Comments

@greenlee
Copy link

greenlee commented Jun 8, 2020

Hello,
New to python and haven't been able to figure this out.
running python 2.7.18 in windows 10 command prompt.
I put the latest error in the title, AttributeError: 'datetime.datetime' object has no attribute 'timestamp' .
but prior to that, I was getting, Traceback (most recent call last):
File "C:\google-data-analyses-master\get_visit_times.py", line 87, in
data.clear()
AttributeError: 'list' object has no attribute 'clear' .
not sure if the two are related. I was able to bypass the clear error by commenting out the #data.clear() line. have lots of memory so figured why not.
the latest error I get is bellow.

C:\google-data-analyses-master>get_visit_times.py
Loading 'C:\google-data-analyses-master\Location History.json' ...
JSON file loaded
Extracting relevant data...
Total number of points: 4171876
Traceback (most recent call last):
File "C:\google-data-analyses-master\get_visit_times.py", line 95, in
begin_ts = date_ymd_to_timestamp_ms(2019,01,01)
File "C:\google-data-analyses-master\get_visit_times.py", line 24, in date_ymd_to_timestamp_ms
return datetime.datetime(y,m,d).timestamp()#*1e3
AttributeError: 'datetime.datetime' object has no attribute 'timestamp'

@matthieuheitz
Copy link
Owner

Hi !
You need to run the script with Python 3 instead of Python 2 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants