Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [date]

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

4
votes
4answers
342 views

Hey, what time is it?

Challenge Given a number width, number height, hours and ...
14
votes
12answers
4k views

A greeting bot for a colleague from work

I have a colleague at work that works from home every Tuesday and Thursday. At around 8:00 AM he sends us a message with the following text: Hello today I'm working from home In order to relieve ...
7
votes
16answers
1k views

Greet according to the time of day

Challenge Write a program that greets a user depending on what time of day (GMT) it is. Output A string (printed or returned) according to these rules: If the time is 06:00 to 11:59 the greeting ...
14
votes
8answers
2k 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 ...
9
votes
10answers
521 views

The Clock Hands of Doom

You are chained to a chair. Underneath you is a huge volcano. A 12-hour clock next to you ticks ominously, and you see that it has wires leading from the back up to a chain, which will drop you into ...
14
votes
11answers
870 views

Computing time sheets

Time sheets In a work place you often have to complete time sheets. This task is write code to help this. Input Two times in a slightly non- standard 12 hour clock signifying the start and end of ...
5
votes
4answers
350 views

Einstein's Sorter

Challenge Given a list of integers and a velocity, \$v\$, implement a sorting algorithm which simulates a program sorting the list from smallest to biggest at the given velocity. Einstein's Theory ...
9
votes
10answers
338 views

Date Occurrences

Given three non-negative integers y, m, and d (of which at least one must be positive) and a ...
26
votes
22answers
3k views

Setting the time

Imagine the following 24-hour clock that can be controlled by arrow keys: ╔══╗ ┌──┐ ║00║:│00│ ╚══╝ └──┘ HH mm Pressing the up arrow twice (...
34
votes
6answers
2k views

COBOL Y2K redux

In the 1990s, COBOL computer engineers worked out a way to extend six-digit date fields by converting them to YYYDDD where YYY ...
23
votes
13answers
2k views

Prime Time Travel

Don't tell anyone, but I've nicked my uncle's time travel machine! My uncle is obsessed with prime numbers, though, and that shows in the machine — he has programmed it so that it can only go to dates ...
17
votes
16answers
1k views

Count the timespans

Inspired by a real-life scenario, which I have asked for an answer to here: https://superuser.com/questions/1312212/writing-a-formula-to-count-how-many-times-each-date-appears-in-a-set-of-date-ran ...
29
votes
22answers
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 ...
16
votes
26answers
2k views

Date Multiplying Challenge

(Inspired by last week's Riddler on FiveThirtyEight.com. Sandbox post.) Given a year between 2001 and 2099, calculate and return the number of days during that calendar year where ...
32
votes
9answers
3k views

The symmetry of months

Introduction Some months are completely symmetric, meaning they have central symmetry as well as reflection symmetry, like February of 2010: ...
9
votes
4answers
245 views

Ticking Quine-Bomb!

Challenge: Create a program or function that takes an integer input, which outputs a new program/function as specified below. Input: Integer n: Time in seconds ...
29
votes
19answers
3k views

How old is it roughly?

Write a short program which takes in a positive number of seconds representing an age, and outputs an estimate of that time in English. Your program must output the least precise amount of time which ...
12
votes
12answers
969 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 ...
35
votes
41answers
8k 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 ...
14
votes
6answers
710 views

Match the Striking Clock

Introduction: At home we have a clock that strikes the stated amount at each hour, but also strikes once at every half-hour. So from 0:01 to and including 12:00 it strikes in this order: ...
15
votes
9answers
713 views

Finding My Favorite Times

I really like times that follow certain patterns. In particular, I like times where all the digits are the same, or all of the digits increase arithmetically by one from left to right. Further, I ...
14
votes
7answers
704 views

Could They Be The Same Day Of The Week?

Challenge Given a non-negative integer, output whether it is possible for two dates (of the Gregorian calendar) differing by exactly that many years to share a day of the week. A year is assumed to ...
25
votes
35answers
3k views

Implement a Simple Stopwatch

Challenge Your task is to write a program which, once a second (including immediately when your program is started), prints the elapsed time from the time your program was started. Rules Time must ...
9
votes
1answer
435 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 ...
37
votes
26answers
10k 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 ...
7
votes
7answers
354 views

The Microwave Challenge

Inspired by this comment. Input The number of seconds on the timer. Output Here's our basic microwave: ...
24
votes
6answers
1k views

128 years? Hypothetical leap year reform

The solar year is 365 days, 5 hours, 48 minutes, 45 seconds, and 138 milliseconds, according to this video. With the current Gregorian calendar, the rules for leap years are as follows: ...
44
votes
19answers
8k views

Type the Alphabet - as fast as you can!

Your task is to make a program that measures how fast you can type the letters of the English alphabet. The program shall only accept lowercase letters a to ...
24
votes
27answers
4k views

How many days in a month?

Given a textual representation (case-insensitive full name or 3 character abbreviation) of a month return the number of days in the month. For example, december, <...
6
votes
4answers
354 views

Digital Calendar

Given a date, output the X and Y position of the current day of the date on a digital calendar. The digital calendar is sort of the calendar that gets shown when you click on your computers clock (at ...
25
votes
17answers
3k views

Simulate My Stupid Old Alarm Clock

I have a stupid old alarm clock with two buttons: hour and minute. The hour button increments the hour of a set alarm, and minute increments the minute time of a set alarm. However, some smart ...
9
votes
7answers
618 views

Date within range?

Given a MM/DD date (12/24) and a start/end date range (11/01 - 06/24), figure out if the ...
7
votes
10answers
600 views

These Days Work for Me

Background You're an attractive code golfer and quite a few people are asking you out. You don't have time to think about which days exactly you're available, so you decide to create a function the ...
10
votes
7answers
801 views

Read my free-form date

Given a date written in any (must handle all in the same program) of the following formats, parse it into a valid yyyy/mm/dd date. ...
1
vote
2answers
355 views

Happy New Year 0409!

The date 0409·01·MO is New Year’s Day in the Ceres Calendar. Wish everyone and everything in the Asteroid Belt, Jupiter, Saturn and beyond a belated Happy New Year by writing a program to convert ...
28
votes
10answers
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 ...
10
votes
6answers
256 views

What's the date, in Usenet time?

September 1993 is known on Usenet as the September that never ended. Thus, for example, the day this question is being posted is Saturday, September 8740, 1993. Your program or function should take ...
7
votes
12answers
979 views

The Counting Gate Keeper

Related as it requires you to measure the time between the first and last input. But here you're required to count how many inputs in a period of time. I was assigned a task to stand by a gate and ...
6
votes
3answers
161 views

Who was the biggest “Weekend Update” host during that time period?

These are the hosts of the "Weekend Update" news segment on Saturday Night Live, with the years they hosted and their initials: ...
15
votes
23answers
1k views

Have I had lunch yet?

You love lunch. However, you are on a diet and want to make sure you don't accidentally eat lunch twice in one day. So you need to make a program to help you make sure. However, one complication is ...
14
votes
14answers
1k views

Short Date into English Long Date

Convert short date format into English long date in as few bytes as possible. Input Input will be in the form of a string with format, yyyy-mm-dd, with zero ...
5
votes
0answers
71 views

Time calculator [duplicate]

This challenge is related to a project I did last year (in Ruby). To make it more fun I decided to do it in as few bytes as possible. I didn't know about code golf back then so now that I found out ...
13
votes
5answers
416 views

Today in the YOLD

The Discordian calendar is an alternative calendar used by Discordians. The discordian year has 5 seasons, each lasting 73 days: Chaos, Discord, Confusion, Bureaucracy, and The Aftermath. The ...
10
votes
9answers
1k views

What is this date format?

For Gregorian calendars, the date format varies from a country to another. There are three main formats recognized: YY-MM-DD (big-endian) ...
14
votes
1answer
496 views

Github Messenger

Goal: This goal to take a string and output how many contributions should be made on which days in order to display a message. Specification Input Support letters plus space (i.e. ...
23
votes
55answers
3k views

What's the Date?

Challenge Weirdly, this hasn't been done yet: output the current date. Rules The date format you should follow is as follows: YYYY-MM-DD Where the month and ...
11
votes
10answers
1k views

When's the nearest special common year?

A common year is a year that is not a leap year and where the first and last day of the year are on the same day. A special common year is one that starts on a Monday and so ends on a Monday as well. ...
-8
votes
3answers
176 views

What season is it? [closed]

Task When running the program must show the season according to the host computer's current time. Rules The output must be either: Spring, Winter, Summer or Autumn. The capitalization does not ...
-3
votes
1answer
108 views

Lots of seconds! [closed]

OUTPUT: The number of seconds since midnight on January 1, 1 A.D., as an integer. INPUT: None, you must pull the current timestamp yourself. TASK: This is code-golf, shortest answer in bytes ...
8
votes
9answers
901 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 ...