This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2020-02-14 14:19:48 +00:00
|
|
|
"""Time utilities"""
|
|
|
|
import datetime
|
2020-05-09 18:54:11 +00:00
|
|
|
from typing import Optional
|
2020-02-14 14:19:48 +00:00
|
|
|
|
|
|
|
|
2020-05-09 18:54:11 +00:00
|
|
|
def get_time_string(delta: Optional[datetime.timedelta] = None) -> str:
|
2020-02-14 14:19:48 +00:00
|
|
|
"""Get Data formatted in SAML format"""
|
2020-02-14 14:34:24 +00:00
|
|
|
if delta is None:
|
|
|
|
delta = datetime.timedelta()
|
2020-02-14 14:19:48 +00:00
|
|
|
now = datetime.datetime.now()
|
|
|
|
final = now + delta
|
|
|
|
return final.strftime("%Y-%m-%dT%H:%M:%SZ")
|