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

learn more… | top users | synonyms (3)

8
votes
6answers
456 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 ...
73
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
491 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
141 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
608 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 ...
9
votes
10answers
648 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
720 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
387 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
114 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
198 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
583 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
222 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 ...
8
votes
9answers
541 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
612 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 ...
8
votes
6answers
591 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 ...
4
votes
4answers
495 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 ...
15
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 ...
3
votes
3answers
281 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. ~$ ...
2
votes
5answers
1k 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 ...
6
votes
5answers
809 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 ...
6
votes
4answers
458 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, ...
7
votes
7answers
371 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. ...
7
votes
7answers
376 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 ...
10
votes
19answers
999 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 ...