tmux_styler.Statusbar.Segments.DateTime

 1from . import DefinedSegment
 2
 3
 4def date_day() -> DefinedSegment:
 5    """
 6    The current day of the week.
 7    """
 8    import datetime
 9    current_date = datetime.datetime.now()
10    return current_date.strftime("%A")
11
12
13def date(format="%Y-%m-%d") -> DefinedSegment:
14    """
15    The current date.
16
17    Parameters:
18    -----------
19    `format` (str):
20        The format of the date. Defaults to "%Y-%m-%d".
21    """
22    import datetime
23    current_date = datetime.datetime.now()
24    return current_date.strftime(format)
25
26
27def time(format="%H:%M") -> DefinedSegment:
28    """
29    The current time.
30
31    Parameters:
32    -----------
33    `format` (str): 
34        The format of the time. Defaults to "%H:%M".
35    """
36    import datetime
37    current_date = datetime.datetime.now()
38    return current_date.strftime(format)
def date_day() -> str | tmux_styler.ContextVars.ContextVar | list[str | tmux_styler.ContextVars.ContextVar]:
 5def date_day() -> DefinedSegment:
 6    """
 7    The current day of the week.
 8    """
 9    import datetime
10    current_date = datetime.datetime.now()
11    return current_date.strftime("%A")

The current day of the week.

def date( format='%Y-%m-%d') -> str | tmux_styler.ContextVars.ContextVar | list[str | tmux_styler.ContextVars.ContextVar]:
14def date(format="%Y-%m-%d") -> DefinedSegment:
15    """
16    The current date.
17
18    Parameters:
19    -----------
20    `format` (str):
21        The format of the date. Defaults to "%Y-%m-%d".
22    """
23    import datetime
24    current_date = datetime.datetime.now()
25    return current_date.strftime(format)

The current date.

Parameters:

format (str): The format of the date. Defaults to "%Y-%m-%d".

def time( format='%H:%M') -> str | tmux_styler.ContextVars.ContextVar | list[str | tmux_styler.ContextVars.ContextVar]:
28def time(format="%H:%M") -> DefinedSegment:
29    """
30    The current time.
31
32    Parameters:
33    -----------
34    `format` (str): 
35        The format of the time. Defaults to "%H:%M".
36    """
37    import datetime
38    current_date = datetime.datetime.now()
39    return current_date.strftime(format)

The current time.

Parameters:

format (str): The format of the time. Defaults to "%H:%M".