# Questions tagged [date]

This challenge is intended to be solved by using, manipulating, accepting as input, outputting, or calculating calendar dates or clock times.

87 questions
Filter by
Sorted by
Tagged with
3k views

### crossed out 44 is still regular 44 ;(

Introduction On March 24th, 2015 @isaacg golfed his Pyth answer from 44 to 42 bytes. Since a crossed out 44 (44) looks a lot like a regular 44, @Optimizer made the following comment: striked out ...
• 128k
5k views

### The Work Day Countdown

I just had a genius idea for making the work-life easier - a countdown to a specific date which only counts workdays. The basic task is to create a countdown to a specific date which only includes ...
• 389
10k views

### Is it a leap year?

This challenge is quite simple. You will take an input which will be a year from 1801 to 2400, and output if it is a leap year or not. Your input will have no newlines or trailing spaces: ...
4k views

### Is it Christmas?

Challenge Given that Christmas is: December Month 12 Day 25 Every year, determine today's date, and whether or not today is Christmas. If it is Christmas, you must print ...
3k views

### Calculate the date of Easter

Your function or program should take a year as input and return (or print) the date (in the Gregorian calendar) of that years Easter (not the Eastern Orthodox Easter). The date returned should be ...
• 3,326
9k views

### Convert YYYYMM to MMMYY

Basing on this SO question. Challenge is rather simple: given a date period in the format YYYYMM output it in the format MMMYY. ...
• 17k
2k views

### Decimal Time of Day Conversion

Introduction Time is confusing. Sixty seconds to a minute, sixty minutes to an hour, twenty-four hours to a day (and not to mention that pesky am/pm!). There's no room for such silliness nowadays, so ...
• 3,572
5k views

### I'm too cold, turn up the temperature

This is my first golf contest. What you need to do Build me, in the shortest amount of bytes possible, my AC remote control system. My room is too cold right now, and I'm missing my remote. Now, I ...
9k views

### Stop, stand there where you are!

Challenge Write a function which takes one parameter: an integer t. Your function has to stop your program for t seconds before ...
• 23.4k
4k views

### The Time Anagram

Originally posted (and deleted) by @Tlink, which was most likely inspired from this StackOverflow question. Since it was a shame it got deleted, because it seemed like a good challenge in general, I ...
• 128k
5k views

### It's a yearly task, alright

Given a number 1≤n≤365, output the nth day of the year in "Day-numberth Month" format. For example, given 1, you should output "1st January", without "of". The Gregorian calendar will be used and the ...
• 3,849
898 views

### Change the Timezone

Challenge Given a time and a timezone as input, output the time in that timezone. Time The time will be given in 24 hour format like so: hh:mm Where hh is the ...
• 23.4k
1k views

### Superstitious Programming

Your challenge is extremely simple. Given a year as input, print all the months in that year that will contain a Friday the 13th according to the Gregorian calendar. Note that even though the ...
• 59.3k
1k views

### Day of the week of the next Feb 29th

Write a function which takes a date and returns the day of the week of the next February 29th after that date. The input is a string in the ISO Extended format: YYYY-MM-DD (e.g. May 27th, 2010 would ...
2k views

Write a program that takes a birth date (month and day-of-month) as input and outputs the corresponding sign, element and quality of the western zodiac. For the purposes of this challenge, these are ...
• 72.2k
1k views

### What's the day today (or other dates)?

Task Write a program or a function that calculates a week-day name of a date which a user inputs. Input & Output Input is a string, YYYYMMDD. Example of ...
• 3,452
5k views

### Calculate Chinese Zodiac sign

Given that the Chinese New Year is coming, here is a challenge to calculate the Chinese Zodiac, element and Taijitu for a given date. The input should be a date: ...
• 1,949
11k views

### Has my milk expired?

Aww, man, this expiry date doesn't write the months with letters! I can't tell if it's expiring on March 10th or October 3rd... Wait, no, never mind, the year says 2012. (alley-oops half-used brick of ...
• 8,806
7k views

### Legen… wait for it…

dary! In events entirely unrelated to what will hopefully happen to me in the next couple of days, I task you to write code that does the following: Print ...
• 210k
7k views

### Automate Saving the World

You are Desmond Hume. For the last 3 years, you and your partner, Kelvin, have been slave to a computer that requires a very specific sequence to be entered into it every 108 minutes to save the world....
• 59.3k
8k views

### Who was president of the USA?

Challenge Write a program that takes as input a day from April 30, 1789 to August 21, 2019 and returns as output who was president of the USA that day. Notes For the list of US presidents, the ...
• 669
7k views

### Encode the date in Christmas Eve format

The day this post was published was Christmas Eve. Tomorrow will be Christmas. Yesterday was Christmas Eve Eve. In two days it will be ...
• 7,245
9k views

### We had a question once which only failed on Sundays

Inspired by We had a unit test once which only failed on Sundays, write a program or function that does nothing but throw an error when it is Sunday, and exit gracefully on any other day. Rules: No ...
• 47.3k
5k views

### Output the Current Time

Challenge You must output the current time continuously (until cancelled by an interrupt), once every second, by any of the following means: It must be in 24-hour or AM/PM format. If it is the ...
• 11.2k
8k views

### When will Brexit happen?

Well, Brexit happened. And Sky News, being the geniuses they are, have decided to create a countdown on the side of a bus. Your job is to do something similar. The UK leaves the the EU on 31st of ...
2k views

### Alarm Optimization

My Alarm Clock I'm American, and so is my (digital) alarm clock. To set the alarm, it starts at the time it was previously. Hitting the hour button moves it up one hour, and hitting the minute button ...
• 14k
3k views

### Analog is Obtuse!

An analog clock has 2 hands*: Hour and minute. These hands circle the clock's face as time goes by. Each full rotation of the minute hand results in 1/12th of a rotation of the hour hand. 2 full ...
• 11.6k
745 views

### Help me manage my time

I have been recently told to read an entire physics textbook by the new year (true story, unfortunately). I need your help to determine what chapters I should read each day. This is where you come in. ...
• 7,592
2k views

### Next Friday the 13th

What is the shortest program that can predict the next time Friday will fall on the 13th day of the month? Must be an complete functioning program (not just a function/subroutine) Must print out date ...
2k views

### List all palindromic prime dates between 0000-01-01 and 99999-12-31

You know what a palindrome, a prime and a date are. Your task is to list all dates in 100 thousands of years that fulfill all three characteristics. Nevermind anything but the numbers, use the ...
• 1,796
496 views

### The working time calculator

This is based on how my company deals with the monitoring of the working times for every employee. Each one of us has a card that can be passed in front of a sensor, so that a clock registers the ...
• 12.9k
1k views

### What week is it?

The day of the week and month of the year seem to get a lot of attention but no one seems to care about the week of the year. I believe it's time to change that, so your job is to write a program or ...
• 361
678 views

### Output: Calendar Month (without native calendar generating functions)

Upon receiving month and year in YYYYMM format, generate output of the corresponding calendar month for that year. For example the input 201312 should generate ...
• 7,531
3k views

### C: Output "tomorrow's date"

I'm a code golf novice, but I'm eager to give it a go. My challenge is: Write the shortest program in C which takes in a date D as input and outputs the date ...
• 4,755
5k views

### Print a word clock

Since I saw the first one a few years ago, I always was subjugated by this kind of word clock where the time is actually spelled out by words being lit up or not into a meaningful sentence. The text ...
• 14.4k
3k views

### Read a date in xkcd notation

In his xkcd about the ISO 8601 standard date format Randall snuck in a rather curious alternative notation: The large numbers are all the digits that appear in the current date in their usual order, ...
• 197k
7k views

### Use xkcd's formula to approximate the world population

In xkcd 1047, Randall Munroe lists "slightly wrong" approximations of assorted quantities and numbers with varying precision and complexity, such as that the number of liters in a gallon is very close ...
• 10.3k
11k views

### Happy Birthday, Finland!

Introduction As is known, in 2017, Finland celebrates its 100 years of independence. To mark the occasion, it is your job to produce a Finnish flag for everyone's enjoyment. Challenge Create a ...
• 969
5k views

### Advance Happy New Year, 2016!

Your input will be a integer between 1970 and 2090 (inclusive), representing a year. Your program should output the next year on which New Years Day falls on the same day of the week as the input year....
• 969
30k views

### When is Thanksgiving?

Background Some holidays have fixed, easy-to-remember dates, like Oct 31, Dec 25, etc. Some, however, want to be troublesome. They're specified as things like "the first Monday in September" or "the ...
• 2,272
7k views

### Is it really time?

A time in the format hhMMss is represented by six numbers in the range 0..9 (e.g.100203 for 3 seconds after 2 minutes after 10am (10:02.03), or ...
• 1,597
8k views

### How many friday the 13th in a year?

Your challenge is to write a program which, given a year, outputs the number of "Friday 13ths" in it. Rules & Details: You can take input via STDIN, or as an ...
• 2,283
5k views

### Help, I've mixed my week up!

My dog ate my calendar, and now my days are all mixed up. I tried putting it back together, but I keep mixing up the days of the week! I need some help putting my calendar back together, with the days ...
• 6,897
4k views

### The Last Monday

Monday, October 31st, is Halloween. And it got me thinking -- I wonder what other months have the last day of the month also be a Monday? Input A positive integer in any convenient format ...
• 43.5k
2k views

### Compute the RFC 2550 timestamp

RFC 2550 is a satirical proposal (published on April 1, 1999) for a space-efficient ASCII representation of timestamps that can support any date (even those prior to the beginning of the universe and ...
3k views

### Days in indexed month

This simple challenge is very similar to this one: How many days in a month? The only difference is you yield the number of days in a month given the index of the month instead of its name. The ...
• 653
5k views

### Leap for Leap Seconds!

Since today marks the occasion of the 26th leap second ever to occur, your challenge will be to output the date and time of every leap second in GMT or UTC that has occurred so far, as well as the one ...
• 23.4k
6k views

### 12 hour to 24 hour time converter

Amazingly, this simple task doesn't seem to exist already, so... Your task is to write a program that takes as input a 12 hour time, and converts it into "military time", or 24-hour time format. ...
• 3,568
3k views

### Return the clock emoji closest to the current time when run

I can have a large if/else condition for each 30 minutes but I'm looking for more math and Unicode based solution. Here are clock emojis: 🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕜�...
• 825