Toggle navigation
Camper
Home
Past Barcamps
Blog
Ideas / Feedback
deutsch
Login
Register
Online
, Online, 00000 Online
Jan 30, 2021 - Jan 30, 2021
×
Open menu
Home
session proposals
events
Code of Conduct
Homepage
Events
BARCAMP
Wer kann @decorator an diesem Beispiel erklären
I like this session
I don't like this session
Wer kann @decorator an diesem Beispiel erklären
by Rainer Treichel
``` # Return local time (hrs: int, mins: int, secs:float) @property def local_time(self): t = self.epoch_time + int(3600 * self.local_offset) _, _, _, hrs, mins, secs, *_ = self._localtime(t) return hrs, mins, secs @property def date(self): t = self.epoch_time + int(3600 * self.local_offset) y, m, d, *_ = self._localtime(t) return d, m, y - 2000 @property def utc(self): t = self.epoch_time _, _, _, hrs, mins, secs, *_ = self._localtime(t) return hrs, mins, secs def time_string(self, local=True): hrs, mins, secs = self.local_time if local else self.utc return '{:02d}:{:02d}:{:02d}'.format(hrs, mins, secs) def date_string(self, formatting=MDY): from .as_GPS_utils import date_string return date_string(self, formatting) ```
Documentation