Pular para conteúdo

Helper

convert_date(time)

Convert time to date format

Parameters:

Name Type Description Default
time str

Time in string format

required
Source code in cartola_project/transformations/helpers.py
 7
 8
 9
10
11
12
13
14
15
16
def convert_date(time: str) -> str:
    """Convert time to date format

    Args:
        time: Time in string format

    Returns: Time in string format
    """
    time = parser.parse(time)
    return time.strftime("%d-%m-%Y")

convert_time(time)

Convert time to time format include hour and minute

Parameters:

Name Type Description Default
time str

Time in string format

required
Source code in cartola_project/transformations/helpers.py
19
20
21
22
23
24
25
26
27
28
def convert_time(time: str) -> str:
    """Convert time to time format include hour and minute

    Args:
        time: Time in string format

    Returns: Time in string format
    """
    time = parser.parse(time)
    return time.strftime("%d-%m-%Y %H:%M")