Skip to content

Tag Archives: Python datetime-program

Given two dates, our task is to write a Python program to get total business days, i.e weekdays between the two dates. Example: Input :… Read More
Given a date, the task is to write a Python program to get the most recent previous business day from the given date. Example: Input… Read More
Given a year and weekday, the task is to write a Python program to get a month and the week. Example: Input : test_year =… Read More
Given a date list and date range, the task is to write a Python program to check whether any date exists in the list in… Read More
Given a date, our task is to get the weekday index and year range, compute the total occurrence of the date on a particular weekday… Read More
Given a date and weekday index, the task is to write a Python program to get the date for the given day of the week… Read More
Given a list of dates, the task is to write a Python program to check if all the dates are consecutive in the list. Input… Read More
Given a string, the task is to write a Python program to extract date from it. Input : test_str = "gfg at 2021-01-04" Output :… Read More
Given a date, and the task is to write a Python program to create a list of range of dates with the next K dates… Read More
Given a date and list of dates, the task is to write a python program to find the nearest date in the given input list… Read More
Given a datetime object or month number, the task is to write a Python program to get the corresponding month name from it.  Examples: Input… Read More
Given a datetime object, the task is to write a Python Program to compute the last date of datetime object Month. Examples: Input : test_date… Read More
In this article, we will discuss how to convert date and time with different timezones in Python. To do this we will use one of… Read More
In this article, we are going to discuss how to print current hour, minute, second, and microsecond using Python. In order to print hour, minute… Read More
Given the number of seconds, the task is to write a Python program to calculate the date, month, and year in the format MM-DD-YYYY that… Read More