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

learn more… | top users | synonyms (4)

6
votes
6answers
245 views

I hate Mondays!

You should a program in language X, which will only output its source code (i.e function as a quine) when it is not a monday. On monday it should output some string with a levehnstein distance of 4 ...
15
votes
9answers
933 views

Forecast Palindromic Dates

Palindromic dates are dates that appear as palindromes: the string of digits can be read the same way backwards as forwards. For the North American date format (MM/DD/YYYY), the next few palindromic ...
48
votes
30answers
4k 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. Rules: The input will be a number or a string exactly 6 characters ...
60
votes
33answers
9k views

Wait a minute – in less than ten seconds

Task Using any type of parallelisation, wait multiple periods, for a total sleep time of at least a minute (but less than a minute and a half). The program/function must terminate within 10 seconds ...
9
votes
3answers
264 views

Simplify a Date

This is similar to simplifying fractions, but with Dates! The input of your program must be of the form mm/dd For example 3/4 //March 4 12/15 //December 15 1/1 // January 1 We assume that the ...
9
votes
9answers
386 views

What's the Binary Time?

What's the Binary Time? Everybody knows what the normal time is. It's up there in the top-right (or wherever you put it) of your screen. But a question people rarely seem to ask themselves is this: ...
18
votes
28answers
3k views

24 and 12 Hour Times

Write a program or function with no input that prints or returns this string of 24-hour and 12-hour times: 00:00 12:00am 01:00 1:00am 02:00 2:00am 03:00 3:00am 04:00 4:00am 05:00 5:00am 06:00 6:...
10
votes
1answer
155 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 ...
8
votes
3answers
507 views

420 <s>Blaze</s> Golf It

This is a pretty simple challenge, but (I hope) a fun one. Task If right now either the month is 4 and the day is 20, the hour (on a 12 hour clock) is 4 and the minute is 20, or the minute is 4 and ...
11
votes
1answer
178 views

Beat Pure Regular Expressions at Validating ISO 8601 Dates

In ValiDate ISO 8601 by RX, the challenge was to use only standard regular expressions to validate standard date formats and values (the former is a common job for RX, the latter was unusual). The ...
7
votes
2answers
169 views

Roman-style date formatting

Today (March 15) is the Ides of March, best known for being the date that Julius Caesar was assassinated. What's “Ides”? Well, the ancient Romans didn't simply number the days of month from 1 to 31 ...
25
votes
37answers
7k views

Happy Rounded Pi Day

To celebrate Rounded Pi Day, you must take advantage of today's date to make a program that takes in a circle's diameter and outputs its circumference by multiplying the diameter by 3.1416, where 3....
3
votes
1answer
193 views

Graduation Meme Tally

Now that we're graduating, it's time to tally up the number of times someone suggested that PPCG was graduating, even before the annoucement! (see here) Your program will receive a list of chat ...
4
votes
19answers
518 views

Read an analog clock

You are given the positions of the minute and hour hands of an analog clock as an angle of clockwise rotation from the top (12). So a hand pointing at 9 is at an angle if 270, and a hand pointing ...
17
votes
3answers
288 views

Generate lazy microwave input

Related: Program my microwave oven and Generate lazy values. My colleague is so lazy that he doesn't even bother to move his finger when programming the microwave oven. (This is actually true!) Help ...
3
votes
1answer
287 views

What time is it again? [closed]

The Inspiration The Challenge I'm tired of seeing the same old-same old clock in my top-right-hand corner of my screen. It's time for a new clock. While the clock clock sated my lack of interesting ...
-5
votes
15answers
651 views

Is the time linear?

I like patterns in time. My favorite is when the time lines up. For example, all of these line up: 3:45 12:34 23:45 3:21 6:54 This is because each digit in the hour/minute is increasing/decreasing ...
0
votes
0answers
60 views

Is it a leap year? Use only assignments and arithmetic expressions [duplicate]

Write a program that outputs 1 when the year is a leap year, otherwise 0. You can use any programming language, but use only assignments and arithmetic expressions for the calculation. The Gregorian ...
2
votes
0answers
100 views

Convert string to time

This challenge is inspired by this other. The challenge Write a program or a function in any programming language that given as input a string representing a time in English (see below, for further ...
15
votes
6answers
340 views

Convert the Time to a String

Problem One day, you boss walks up to you and tells you he needs to know the time. He still insists after you pointing at the clock directly above you head, and confesses he has a severe case of ...
14
votes
3answers
328 views

Check work periods

Introduction Here in Germany the ruling on work times is very strict. If you work 6 or more hours a day, you have to take at least a 30 minute break. If you work 9 or more hours, you need to take a ...
8
votes
4answers
376 views

Calculate the day number of the year

Seems like we do not have this one yet, so here we go: The Challenge Write a program or function that takes a date as input and outputs the day number of the year. You may not use any builtins for ...
14
votes
9answers
472 views

Next public holiday

Australians love public holidays, and drinking. Yesterday, the 26th January, was Australia day, which is a public holiday. I was glad to not be at work yesterday, and eager to know the next time I get ...
10
votes
1answer
306 views

Calculate the Lunar Phase

Introduction tl;dr In this challenge you have to calculate the moon's phase for a given date. This challenge is inspired by the game psycho social audiovisual experiment "Superbrothers: Sword &...
11
votes
3answers
346 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 ...
16
votes
11answers
1k views

Pi Day, Pi Minute, or Pi Second?

In this challenge you will need to determine whether it's Pi Day, Pi Minute, or Pi Second. Because Pi is irrational, it wants your code to be as short as possible. Examples No input is provided, ...
8
votes
15answers
468 views

Chinese Zodiac of the year

2015 was the year of the goat! In this challenge, you will figure out which animal represents the year. To avoid making this challenge to complex you won't need to calculate Chinese new year. Because ...
25
votes
16answers
1k views

ASCII clock with dot & comma time markers

Introduction Imagine that line of chars is in fact two rows. Upper row - dots - represents hours (24 hour system), while lower - commas - represents minutes. One character can represent hour, ...
16
votes
2answers
331 views

Forgotten Realms date calculator

In an effort to level the playing field between languages with built-in date libraries and those without, let's work with a fictional calendar. The Forgotten Realms are a (the?) campaign setting for ...
1
vote
5answers
104 views

Parrot User’s Delay [duplicate]

A simple code golf challenge similar to an already existing, but more complex one: Wait for user to press enter. Wait for user to press enter again. Print the elapsed time between the 1. and 2. Wait ...
41
votes
7answers
2k 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,...
23
votes
7answers
535 views

Convert a date to 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,...
17
votes
6answers
426 views

Rollover Calendar

This is inspired by one of Downgoat's questions in Sandbox, where I suggested that he include April 31 as Pi day for people who use day/month format, only for him to inform me that there is no April ...
13
votes
4answers
379 views

How many weeks?

Your task is to output a single number; the number of ISO weeks that a given date range intersects. To quote Wikipedia: An average year is exactly 52.1775 weeks long, but this is not about the average....
3
votes
2answers
176 views

Create a Winter Bash 2015 hat reminder

Input Two dates, each comprising of a month (Dec or Jan) and a day (01-31). These will be given as 4 integers (12 01 01 01, for example), in any reasonable format you choose (leading zeroes, no ...
37
votes
31answers
4k 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....
10
votes
20answers
2k views

How long ago was this?

How long ago was this? The Rules Each submission must be a full program. The program must take input as two comma-separated dates in the form YYYY-MM-DD, and print the number of days that has ...
22
votes
50answers
2k views

Running length of the movie in a human readable format

Whenever I search for the running length of a movie in IMDb, it is displayed in minutes. Immediately I would try to convert it into hour(s) and minute(s). It would be better if we could automate this. ...
41
votes
76answers
3k 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 ...
46
votes
24answers
4k 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 Legen... wait for it... immediately, ...
37
votes
27answers
4k 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 ...
9
votes
2answers
290 views

Festival of ASCII-art lights

Write, in as few characters as possible, a program that takes zero or six command-line arguments menorah menorah YEAR MONTH DAY HOUR MINUTE SECOND (Both forms must be supported. The zero-argument ...
14
votes
3answers
496 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. ...
22
votes
3answers
407 views

Combined 100 year birthday

I was recently adding up the ages of myself and my wife and kids and realised that at some point in the not-too-distant future our ages will all add up to exactly 100 years. Challenge For an input ...
17
votes
0answers
495 views

Make a math equation from the date

In my Economics class, my friends and I like to come up with ways to rearrange the digits in the date (in MM/DD/YY) format to create a valid mathematical equation. For the most part, we are allowed to ...
11
votes
1answer
242 views

Which Ubuntu versions are supported?

Given an input date, your entry will output the full list of supported versions of the Ubuntu Linux distro on that date. The full list of all releases is as follows: Version Code name ...
49
votes
19answers
6k views

Detect Time Travel

Computers are everywhere nowadays - in cars, trains, skateboards, even nuclear reactors. The possibility that your software will run in a time travelling device is just a matter of time. Can you deal ...
5
votes
5answers
548 views

Arbitrary Clock Time Calculator

Create a routine to calculate the position of each unit of a clock with an arbitrary number of units (minutes, hours, half-days, days, years, parsecs, quarter-quells, etc), where each unit can be ...
17
votes
8answers
2k views

Find our missing dead

Challenge Peter has risen again to save us from the duplicate challenges! Peter Taylor is dead, and there's no doubt about it (well, apart from the huge amount of doubt we have... but just ignore ...