Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3436

Python • Strange behavior of time

$
0
0
I try to manipulate the time and get these errors on raspberry pi.
Running these on my mac in python no problems.

What is wrong?

Code:

    current_time = time.localtime()                    ^^^^^^^^^^^^^^AttributeError: 'Time' object has no attribute 'localtime'  File "/home/pi/Moon/subpoint.py", line 311, in <module>    currentMillis = int(round(time.time() * 1000))  # Convert seconds to milliseconds                              ^^^^^^^^^AttributeError: 'Time' object has no attribute 'time'

Statistics: Posted by Powersoft — Thu Feb 01, 2024 11:36 am — Replies 0 — Views 13



Viewing all articles
Browse latest Browse all 3436

Trending Articles