Timer utility5/9/2023 # get_year_end(timezone=pytz.utc, year = None).Returns the date and time of the beginning of the year with the given timezoneĮxample: from time_utility import TimeUtility day_start = TimeUtility. # get_year_start(timezone=pytz.utc, year = None).get_month_end ( year = 2020, month = 5 ) Returns the date and time of the ending of the month with the given timezoneĮxample: from time_utility import TimeUtility day_start = TimeUtility. # get_month_end(timezone=pytz.utc, year = None, month = None).get_month_start ( year = 2020, month = 5 ) Returns the date and time of the beginning of the month with the given timezoneĮxample: from time_utility import TimeUtility day_start = TimeUtility. # get_month_start(timezone=pytz.utc, year = None, month = None).Returns the date and time of the ending of the day with the given timezoneĮxample: from time_utility import TimeUtility day_start = TimeUtility. # get_date_end(timezone=pytz.utc, year = None, month = None, day = None).get_date_start ( year = 2020, month = 5 ) Įxample: from time_utility import TimeUtility day_start = TimeUtility. Returns the date and time of the beginning of the day with the given timezone # get_date_start(timezone=pytz.utc, year = None, month = None, day = None).Returns an aware instance of today's dateĮxample: from time_utility import TimeUtility today = TimeUtility. timezone => The preferred timezone Įxample: from time_utility import TimeUtility now = TimeUtility.Returns an aware instance of the current datetime ![]() Įxample: from time_utility import TimeUtility from datetime import datetime aware = TimeUtility. target_datetime: datetime.datetime => The target datetime.Returns an aware datetime object based on the naive target_datetime # make_aware(target_datetime, timezone=pytz.utc).now ())Ĭhecks if the given datetime object is awareĮxample: from time_utility import TimeUtility is_it_aware = TimeUtility. target_datetime: datetime.datetime => The target datetime to be checkedĮxample: from time_utility import TimeUtility is_it_naive = TimeUtility.The following are the methods available in TimeUtilityĬhecks if the given datetime object is naive. Import from time_utility import TimeUtility Usage Note: This package requires python 3.6 and higher Time utility is a series of utility methods regarding date and time for python.
0 Comments
Leave a Reply. |