18 lines
653 B
Python
18 lines
653 B
Python
from datetime import datetime, timezone
|
|
|
|
from src.system_var.constants import MILLISEC_FORMAT, YYYYMMDDTHHMMSSTZ
|
|
|
|
|
|
class ExecuteDateTime:
|
|
def __init__(self):
|
|
self.__execute_datetime = datetime.now(timezone.utc).strftime(YYYYMMDDTHHMMSSTZ)
|
|
|
|
def __str__(self) -> str:
|
|
return self.__execute_datetime
|
|
|
|
def to_path(self) -> str:
|
|
return self.__execute_datetime.rstrip(MILLISEC_FORMAT).translate(str.maketrans({'-': '/', 'T': '/', ':': None, '.': None}))
|
|
|
|
def format_date(self) -> str:
|
|
return self.__execute_datetime.rstrip(MILLISEC_FORMAT).translate(str.maketrans({'-': None, 'T': None, ':': None, '.': None}))
|