Timestamp¶
timestamp
¶
TimestampStyle
¶
Bases: DiscordString
flowchart TD
scurrypy.core.timestamp.TimestampStyle[TimestampStyle]
scurrypy.enums.enum_types.DiscordString[DiscordString]
scurrypy.enums.enum_types.DiscordString --> scurrypy.core.timestamp.TimestampStyle
click scurrypy.core.timestamp.TimestampStyle href "" "scurrypy.core.timestamp.TimestampStyle"
click scurrypy.enums.enum_types.DiscordString href "" "scurrypy.enums.enum_types.DiscordString"
Represents styles for Discord's timestamps.
SHORT_TIME = 't'
class-attribute
instance-attribute
¶
Format HH:MM.
MEDIUM_TIME = 'T'
class-attribute
instance-attribute
¶
Format HH:MM:SS.
SHORT_DATE = 'd'
class-attribute
instance-attribute
¶
Format MM/DD/YYYY.
LONG_DATE = 'D'
class-attribute
instance-attribute
¶
Format Month DD, YYYY.
LONG_DATE_SHORT_TIME = 'f'
class-attribute
instance-attribute
¶
Format Month DD, YYYY HH:MM.
FULL_DATE_SHORT_TIME = 'F'
class-attribute
instance-attribute
¶
Format Day, Month DD, YYYY HH:MM.
SHORT_DATE_SHORT_TIME = 's'
class-attribute
instance-attribute
¶
Format MM/DD/YYYY HH:MM.
SHORT_DATE_MEDIUM_TIME = 'S'
class-attribute
instance-attribute
¶
Format MM/DD/YYYY HH:MM:SS.
RELATIVE_TIME = 'R'
class-attribute
instance-attribute
¶
Format from now (e.g., 4 years ago or 5 hours ago).
Timestamp
¶
Bases: str
flowchart TD
scurrypy.core.timestamp.Timestamp[Timestamp]
click scurrypy.core.timestamp.Timestamp href "" "scurrypy.core.timestamp.Timestamp"
Represents a Discord timestamp in ISO8601 format.
seconds: int
property
¶
Convert this timestamp to seconds.
Returns:
-
int–timestamp in seconds
styled_format
¶
Convert this timestamp to one of Discord's format styles.
Parameters:
-
style(TimestampStyle, default:LONG_DATE_SHORT_TIME) –Format style. Defaults to
TimestampStyle.LONG_DATE_SHORT_TIME.
Returns:
-
str–formatted timestamp