Tag Archives: date-time-program

Given an array arr[] consisting of N strings and an array Query[] consisting of Q queries. Each string in arrays arr[] and Query[] is of… Read More
Given a Unix Timestamp T (in seconds) for a given point in time, the task is to convert it to human-readable format (DD/MM/YYYY HH:MM:SS) Example:… Read More
Given a date in the form of a string, the task is to write a Java Program to get the day, month, and year from… Read More
You are given a time T in 24-hour format (hh:mm) and a positive integer K, you have to tell the time after K minutes in… Read More
Given a generic digital clock, having h number of hours and m number of minutes, the task is to find how many times the clock… Read More
Sorting a multidimensional array by element containing date. Use the usort() function to sort the array. The usort() function is PHP builtin function that sorts… Read More
Given an integer n (in seconds), convert it into hours, minutes and seconds. Examples: Input : 12345 Output : 3:25:45 Input : 3600 Output :… Read More
Write a Python program to find the day of the week for any particular date in the past or future. Let the input be in… Read More
Given an integer n which is the number of hours, the task is to convert it into minutes and seconds. Examples: Input: 5 Output: Minutes… Read More
Given birth date in y/m/d format, write a Python program to find the present age in years. Examples: Input : 1997/2/3 Output : 21 years… Read More
Given two dates, Write a Python program to find the total number of days between them. Examples:   Input : dt1 = 13/12/2018, dt2 = 25/2/2019 Output… Read More
Problem: Convert timestamp to readable date/time in PHP Solution: This can be achieved with the help of date() function, which is an inbuilt function in… Read More
Given a String in date format, the task is to convert this String into actual Date. Examples: Input: string = "2018-10-28T15:23:01Z" Output: 2018-10-28T15:23:01Z Input: string… Read More
You are given two string (dd-mm-yyyy) representing two date, you have to find number of all weekdays present in between given dates.(both inclusive) Examples: Input… Read More
Converting the string to Date and DateTime uses several functions/methods like strtotime(), getDate(). We will see what these functions do. strtotime() – This is basically… Read More