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

learn more… | top users | synonyms (3)

23
votes
11answers
2k views

It's Spanish Time!

I have a simple task that should be relatively easy to implement by means of code. Your goal is to write a program that will output the time written in Spanish, given the time in HH:MM format. Many ...
2
votes
1answer
263 views

Make your own clock! [closed]

Write a program which produces a digital clock on the screen. The clock must update every second, and show time in the format 01:23:45 PM. However, you may not use the computer's built-in clock, or ...
2
votes
0answers
365 views

The World in the Future [closed]

In the future, the world will change, there's no doubt about it. For that reason, you have to produce a realistic map of the world n years in the future. The number n should be the number of years in ...
20
votes
12answers
3k views

Plug it back in tonight or this weekend

This is my first code golf so please let me know if it's too broad or if I'm missing any information for a good puzzle! Challenge In Ontario and possibly other areas of the world, electricity is ...
7
votes
5answers
437 views

Shortest script that gives the time passed since a Unix timestamp

What you need to do to win this challenge is to write the shortest "timeago" script that outputs the number of decades, years, weeks, days, hours, minutes, and seconds between a given Unix timestamp ...
47
votes
6answers
2k views

ASCII Art Calendar

Let's make an ASCII art clock and calendar that tells us the current month, day of the month, day of the week, hour, minute, and whether it's night or day (but not the year or second). At any ...
4
votes
3answers
318 views

When is my piversary?

Since I want to celebrate this definitely not nerdy event, your job is to calculate the piversary (pi-anniversary) of a given date. Input Your code has to have a possibilty to input a date in the ...
23
votes
21answers
3k views

When was the last time the date was divisible by n?

A date can be represented by an unsigned integer as such: YYYYMMDD. What you need to do, is write the shortest program or function that figures out the most recent date whose number was divisible by a ...
10
votes
8answers
1k views

What is your star-sign?

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 ...
19
votes
5answers
4k views

Shortest expression for {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}

Given list of integers {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}. For those who interested these numbers are used in weekday calculation. Weekday = (m[n] + d + y + y>>2 + y/400 - y/100) % 7;, where ...
74
votes
14answers
8k 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 ...
4
votes
2answers
520 views

Thwarting the Fry King

Setting The Fry King is a small criminal mastermind from the western european nation of Belgium, more specifically Flanders. He has acquired every single fastfood restaurant in a large part of ...
-4
votes
1answer
148 views

Longest code to reduce words [closed]

Write a code in your favorite language which reduces words To first three characters. Input : One word Output : First three letters For example INPUT : ProGramming OUTPUT : Pro INPUT : ...
5
votes
7answers
620 views

Print the time in a digital watch [duplicate]

Write a program that prints the current time in a digital watch. Rules: The program must use the local timezone. Time is expressed between 00:00 to 23:59 (with only hours and minutes). The program ...
10
votes
10answers
667 views

Find all times that follow a pattern

Your job is write a program that prints all times (in the format HH:MM, 24 hours) that follow any of the following patterns: Hours equal to minutes, e.g. 22:22,01:01 Hours equal to reverse minutes, ...
5
votes
6answers
1k 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/31/2014 The date used here is ...
8
votes
4answers
413 views

Find the next “interesting” time

I happened to glance at my watch today at exactly 11:11:11 (and today is 1/11; too bad it's not 2011), and that got me thinking: I know! I should make a code golf question out of this! I'm a dork. ...
0
votes
2answers
121 views

Party all week end for my birthday? [duplicate]

Knowing a given date (11/28/1973), and supposing I will die when I'm 99, what are the years when my birthday will be a thursday so that I will be able to party all week-end?
19
votes
25answers
2k views

How many friday the 13th in a year?

Given a year, write the shortest program that outputs how many friday the 13ths there are in that year. Input: You may accept the year either through stdin or as an argument to your program. If a ...
2
votes
5answers
201 views

Relative dates in words

Given a specific date, have the code output a relative reference: If the date entered is ahead of the current date, express as "x days from now" or "x weeks, y days from now", or "x years, y weeks, ...
11
votes
7answers
619 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 ...
-2
votes
1answer
228 views

Merge working time periods

You have an array of working time period pairs (from, till) received from user input and written according 24-hour clock format convention. You have to merge these periods if the intersect each ...
7
votes
9answers
603 views

Working Week Completion

I work a standard nine to five. Monday through Friday. I take a half hour for lunch from 12:30 to 13:00. Write me a program which, when run, calculates the percentage of the working week that I have ...
3
votes
9answers
651 views

Day of the week for a given date of this year. Do not use any date tools

Please write a program that takes as input two numbers 'day of the month' and 'month number' for any day of this year (2012) and outputs day of the week. Examples: % ruby ./golf.rb 14 07 # 14th of ...
10
votes
6answers
603 views

How long until this date?

The idea is this: Write a function to print the length of time from now/today's date (at the time the function is called) until a date supplied as an argument. Assumptions: Input date will always ...
5
votes
4answers
563 views

Convert __DATE__-style string to sortable string

Goal is to write the shortest possible C89 and C99-compliant single-module C program which will compute and print out a single-line string whose sort order will correspond with the date given by the ...
17
votes
31answers
2k 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 "It's Christmas". If it is ...
4
votes
3answers
292 views

Shana tova umetuka! (Happy Jewish New Year!)

Write the shortest program, in the language of your choice, that takes as input a year on the Hebrew calendar, and outputs the corresponding Gregorian date for Rosh Hashana, in YYYY-MM-DD format. ~$ ...
3
votes
5answers
2k 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 D + 1 day Rules: program must compile ...
7
votes
5answers
835 views

Compute the difference between two days.

Another date-manipulating problem :P Task Write a program or a function that calculates the difference between two dates given by a user. Input & Output Similar to the previous one, inputs ...
7
votes
4answers
485 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 input values: 20110617 : June 17, ...
10
votes
9answers
508 views

Percentage of work days in a month

Given a year and a month, find out the percentage of work days in said month. Work days are Monday through Friday with no regard to holidays or other special things. The Gregorian calendar is used. ...
10
votes
10answers
648 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 ...
11
votes
19answers
1k 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 ...