This puzzle is an extension of the famous interview problem, find angle between hour and minute hand at any given time. The questions asks us… Read More
Tag Archives: date-time-program
difftime() is a C Library function. It returns the difference in time, in seconds(i.e. ending time – starting time). It is present in the <time.h>… Read More
Given two times in string “HH:MM” format. Here ‘H’ shows hours and ‘M’ shows minutes. You have to find the difference in the same string… Read More
In order to facilitate finding the current local day, date, and time, C++ has defined several functions in the header file, so functions that will… Read More
Zeller’s congruence is an algorithm devised by Christian Zeller to calculate the day of the week for any Julian or Gregorian calendar date. It can… Read More
Given two clock times (in HH:MM:SS format), change one time to other time in minimum number of operations. Here one operation is meant by shifting… Read More
Given angle theta, find a possible time (in hh:mm format) when angle between hour hand and clock hand is theta. If no such time exists… Read More
Given a date and a positive integer x. The task is to find the date after adding x days to the given date Examples: Input… Read More
Given a time in the format of hh:mm (12-hour format) 0 < hh < 12, 0 <= mm < 60. The task is to convert… Read More
Given a time at 12-hour AM/PM format, convert it to military (24-hour) time. Note: Midnight is 12:00:00 AM on a 12-hour clock and 00:00:00 on a… Read More
Given a date, check if it is valid or not. It may be assumed that the given date is in range from 01/01/1800 to 31/12/9999.… Read More
You are given an year Y, find the next identical calendar year to Y.Examples : Input : 2017 Output : 2023 Input : 2018 Output… Read More
Some of calendar functions are discussed in the Set 1 1. monthrange(year, month) :- This function returns two integers, first, the starting day number… Read More
Python defines an inbuilt module “calendar” which handles operations related to the calendar.Operations on the calendar : 1. calendar(year, w, l, c):- This function displays the… Read More
Some of Time Functions are discussed in Set 1 Date manipulation can also be performed using Python using “datetime” module and using “date” class in… Read More