Updated DatetimeFormatter to include hour/min/sec

This commit is contained in:
Rhet Turnbull
2020-06-13 08:32:56 -07:00
parent 4ba1982d74
commit cf2615da62
2 changed files with 71 additions and 3 deletions

View File

@@ -53,3 +53,18 @@ class DateTimeFormatter:
def doy(self):
""" Julian day of year starting from 001 """
return f"{self.dt.strftime('%j')}"
@property
def hour(self):
""" 2-digit hour """
return f"{self.dt.strftime('%H')}"
@property
def min(self):
""" 2-digit minute """
return f"{self.dt.strftime('%M')}"
@property
def sec(self):
""" 2-digit second """
return f"{self.dt.strftime('%S')}"