2020-11-18 21:20:04 +01:00
|
|
|
class Clock:
|
|
|
|
def __getitem__(self, id):
|
2020-12-21 21:38:44 +01:00
|
|
|
import datetime
|
|
|
|
import time
|
2020-12-23 13:23:57 +01:00
|
|
|
|
2020-11-18 21:20:04 +01:00
|
|
|
now = datetime.datetime.now()
|
|
|
|
ids = {
|
|
|
|
"time": time.time,
|
|
|
|
"year": now.year,
|
|
|
|
"month": now.month,
|
|
|
|
"day": now.day,
|
|
|
|
"hour": now.hour,
|
|
|
|
"minute": now.minute,
|
|
|
|
"second": now.second,
|
|
|
|
# No time_utc?
|
|
|
|
"year_utc": now.utcnow().year,
|
|
|
|
"month_utc": now.utcnow().month,
|
|
|
|
"day_utc": now.utcnow().day,
|
|
|
|
"hour_utc": now.utcnow().hour,
|
|
|
|
"minute_utc": now.utcnow().minute,
|
|
|
|
"second_utc": now.utcnow().second,
|
|
|
|
}
|
|
|
|
return ids[id]
|