Date and Time¶
DateTime¶
-
class
gd.datetime.datetime[source]¶ -
classmethod
from_human_delta(string: str, simple: bool = True) → DT[source]¶ Convert human time delta to datetime object.
- Parameters
- Returns
Datetime object from string.
- Return type
-
to_human_delta(distance_only: bool = False, simple: bool = True) → str[source]¶ Convert datetime object to human delta.
- Parameters
self (Optional[
gd.datetime.datetime]) – Datetime object to convert to string. IfNone,unknownis used.distance_only (
bool) –Whether to display distance only.
distance_only
past time
future time
False30 minutes agoin 10 secondsTrue30 minutes10 secondssimple (
bool) –Whether to return simple human delta, or complex one.
distance_only
simple
time
FalseFalse1 hour, 1 minute and 1 second agoFalseTrue1 hour agoTrueFalse1 hour, 1 minute and 1 secondTrueTrue1 hour
- Returns
Human time delta, like
13 hours agoor42 seconds.- Return type
-
classmethod