GoldyBot.utility.datetime.user_input

 1import dateparser
 2
 3def get_time(human_time_string_OwO:str, time_formats=["%H:%M"]):
 4    """A Goldy Bot util function to read human time string inputs and convert them to a datetime object."""
 5
 6    return dateparser.parse(human_time_string_OwO, 
 7            date_formats=time_formats)
 8
 9def get_date(human_date_string_UwU:str, date_formats=["%d/%m/%Y", "%Y/%m/%d"]):
10    """A Goldy Bot util function to read human date string inputs and convert them to a datetime object."""
11
12    return dateparser.parse(human_date_string_UwU, 
13            date_formats=date_formats)
14
15def get_time_and_date(human_time_date_string_UWU_OWO:str, datetime_formats=["%d/%m/%Y %H:%M", "%Y/%m/%d %H:%M", "%d.%m.%Y %H:%M", "%Y.%m.%d %H:%M"]):
16    """A Goldy Bot util function to read both human date and time string inputs together and convert them to a datetime object."""
17
18    return dateparser.parse(human_time_date_string_UWU_OWO, 
19        date_formats=datetime_formats)
def get_time(human_time_string_OwO: str, time_formats=['%H:%M']):
4def get_time(human_time_string_OwO:str, time_formats=["%H:%M"]):
5    """A Goldy Bot util function to read human time string inputs and convert them to a datetime object."""
6
7    return dateparser.parse(human_time_string_OwO, 
8            date_formats=time_formats)

A Goldy Bot util function to read human time string inputs and convert them to a datetime object.

def get_date(human_date_string_UwU: str, date_formats=['%d/%m/%Y', '%Y/%m/%d']):
10def get_date(human_date_string_UwU:str, date_formats=["%d/%m/%Y", "%Y/%m/%d"]):
11    """A Goldy Bot util function to read human date string inputs and convert them to a datetime object."""
12
13    return dateparser.parse(human_date_string_UwU, 
14            date_formats=date_formats)

A Goldy Bot util function to read human date string inputs and convert them to a datetime object.

def get_time_and_date( human_time_date_string_UWU_OWO: str, datetime_formats=['%d/%m/%Y %H:%M', '%Y/%m/%d %H:%M', '%d.%m.%Y %H:%M', '%Y.%m.%d %H:%M']):
16def get_time_and_date(human_time_date_string_UWU_OWO:str, datetime_formats=["%d/%m/%Y %H:%M", "%Y/%m/%d %H:%M", "%d.%m.%Y %H:%M", "%Y.%m.%d %H:%M"]):
17    """A Goldy Bot util function to read both human date and time string inputs together and convert them to a datetime object."""
18
19    return dateparser.parse(human_time_date_string_UWU_OWO, 
20        date_formats=datetime_formats)

A Goldy Bot util function to read both human date and time string inputs together and convert them to a datetime object.