Questions tagged [date]

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

Filter by
Sorted by
Tagged with
49 votes
23 answers
10k 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 ...
Danko Durbić's user avatar
25 votes
29 answers
5k 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, <...
qw3n's user avatar
  • 751
6 votes
4 answers
451 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 ...
Ian H.'s user avatar
  • 2,926
26 votes
17 answers
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 ...
fireflame241's user avatar
  • 16.2k
9 votes
7 answers
661 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 ...
Xeoncross's user avatar
  • 389
8 votes
10 answers
688 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 ...
Chris Happy's user avatar
10 votes
7 answers
866 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. ...
MysticVagabond's user avatar
2 votes
2 answers
459 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 ...
user avatar
28 votes
10 answers
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 ...
Stephen's user avatar
  • 13.8k
9 votes
6 answers
364 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 ...
msh210's user avatar
  • 3,203
7 votes
12 answers
1k 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 ...
Felipe Nardi Batista's user avatar
6 votes
3 answers
261 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: ...
geokavel's user avatar
  • 6,656
15 votes
23 answers
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 ...
geokavel's user avatar
  • 6,656
14 votes
14 answers
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 padding ...
GarethPW's user avatar
  • 1,299
5 votes
0 answers
79 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 ...
KNejad's user avatar
  • 151
15 votes
6 answers
607 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 ...
L3viathan's user avatar
  • 3,411
12 votes
9 answers
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) ...
Jim's user avatar
  • 1,512
13 votes
1 answer
716 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. ...
NonlinearFruit's user avatar
29 votes
68 answers
4k 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 ...
Beta Decay's user avatar
  • 23.3k
11 votes
10 answers
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. ...
TheLethalCoder's user avatar
-8 votes
3 answers
302 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 ...
Luc H's user avatar
  • 559
-3 votes
1 answer
201 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 ...
Gryphon's user avatar
  • 7,199
8 votes
9 answers
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 ...
J_Lard's user avatar
  • 351
0 votes
9 answers
640 views

Year progress bar

Create a progress bar indicating year progress Your code has to output the percentage of the year already passed form 1st of January of the current year. You have to display a progress bar and the ...
marcosm's user avatar
  • 1,136
15 votes
41 answers
3k views

Pause twice as long

Your challenge is to print the input, wait any amount of time, print the input, wait twice the time you initially waited, print the input again, and so on. The initial delay must be less than 1 hour, ...
user avatar
25 votes
36 answers
5k views

Ring me when our cup noodles are ready [duplicate]

I'm currently cooking us some cup noodles, but we're really sleepy at the moment. They'll be finished in 50 seconds from now, can you wake me up then? Problem: Write a program or function that waits ...
Felipe Nardi Batista's user avatar
9 votes
5 answers
319 views

Determine the busiest time

This challenge was greatly inspired by this Stack Overflow post. Challenge Given a bunch of clients in terms of when they enter a room and when they exit it, determine the period(s) of time when the ...
hyper-neutrino's user avatar
  • 41.3k
14 votes
18 answers
4k views

When will SE be down?

SE will be down/read only today 2017-05-04 at 00:00 UTC until 00:20 UTC. Your challenge is to output a truthy value if SE is down/read only and a falsy value if SE is not. You may not have any input, ...
user avatar
14 votes
6 answers
985 views

Simulate my keyboard

I have an issue with my keyboard (more likely an issue with my browser). Some times when I click on a new text field and begin typing all my text comes out backwards. After a very short amount of ...
Wheat Wizard's user avatar
  • 96.5k
13 votes
17 answers
1k views

Better late than never!

Your program / function, etc. will take 2 inputs. The first will be a list of who came to my party and when. Example: ...
user avatar
27 votes
50 answers
4k views

Print all Sundays in 2017

Print the dates of all the Sundays in 2017 in the following format : dd.mm.yyyy. Expected Output: ...
smanna's user avatar
  • 449
16 votes
15 answers
1k views

Plan your Sundays!

Who doesn't like to chill on a Sunday morning in summer with a chilled beer and TV or in winter playing badminton or ultimate with friends? I always think knowing how many days you have to chill in a ...
Koishore Roy's user avatar
  • 1,203
24 votes
43 answers
4k views

100 Day Countdown

It is common to start countdowns 100 days prior to an event, probably because of our base 10 system. Examples of this can be found everywhere: 100 days until your birthday 100 days until the wedding ...
NonlinearFruit's user avatar
13 votes
28 answers
4k views

Cook me a hot dog! [closed]

Sometimes I find myself wanting a hot dog (don't we all) and so I make one. Now to make a hot dog, it is very simple. 1) Put the hot dogs into boiling water 2) Wait for a certain amount of time (...
user avatar
30 votes
26 answers
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 ...
caird coinheringaahin g's user avatar
4 votes
4 answers
3k views

April Fools Day! [closed]

Your challenge is simple: write a program or function which appears to print the first ten numbers of any integer sequence (on OEIS, the answerer may choose which sequence), but instead prints the ...
vikarjramun's user avatar
35 votes
67 answers
4k views

It's [current year] already, folks, go home

On most new-years challenges when it is currently not the corresponding year of the challenge, It says this in the front. It's [current year] already, folks, go home. You have to output this text ...
Matthew Roh's user avatar
  • 5,353
12 votes
11 answers
2k views

Count how many months are having a full 31 days by counting knuckles

How many of you that still use your own knuckle to determine whether a month is having a full 31 days or less? You job is to write a program to count how many months, in a month range, are having a ...
Rizki Pratama's user avatar
30 votes
26 answers
6k views

How much time is remaining?

The Program You are given two strings, A and B. A is the current position at which your timer is at, and B is the position at which your timer will stop. Both strings are in the format m:ss. You must ...
Josh's user avatar
  • 1,111
13 votes
13 answers
1k views

The Tenacious Thai Calendar

In the Thai calendar the year 2017 corresponds to 2560. The Thai calendar is always 543 years ahead of the Gregorian calendar. Observant coders will note that 2560 is equal to \$2^9 \times 5\$, in ...
Matt's user avatar
  • 299
1 vote
0 answers
106 views

Output the decimal time [duplicate]

For some part of history people in France used a decimal clock. with the clock having 10 hour day, 100 minutes an hour and 100 seconds per minute. Though this clock simplified calculations a bit the ...
Suhrid Mulay's user avatar
2 votes
1 answer
191 views

Is today a real weekday? [closed]

Feb. 6 was a real weekday. Because it lies in the 6th week of the year. So a real weekday is a day with a a day number that equals the week number. But not all country have the same counting of weeks....
Joachim Weiß's user avatar
17 votes
6 answers
464 views

You have a n day streak!

Write a program that keeps track of the number of consecutive days it has been run. The day resets at midnight (the local time of the computer on which the program is run). If there is a day that ...
Daniel's user avatar
  • 6,693
24 votes
17 answers
2k views

Implement a Stopwatch

Implement a simple digital Stopwatch, which will display the time elapsed in seconds and minutes, as described below. Important Please read both Display and Controls sections ! Display Time elapsed, ...
zeppelin's user avatar
  • 8,476
66 votes
14 answers
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 ...
Olivier Grégoire's user avatar
25 votes
37 answers
4k views

It's time for a clock challenge!

I'd like you to build me a clock that displays time in this format: 18 ---------- 19 -------------------------------------------------- This displays '18:10'. The ...
steenbergh's user avatar
  • 8,094
21 votes
38 answers
2k views

Time taken to print numbers

Summary Write a program or function, which doesn't take any input, and outputs all the integer numbers, between -1000 and 1000 in ascending order, to the stdout, one per line, like this: ...
Horváth Dávid's user avatar
28 votes
40 answers
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. ...
Carcigenicate's user avatar
9 votes
1 answer
341 views

Print the current time… taking leap seconds into account

(Note: although related, this challenge is not a duplicate of this one because it requires determining leap seconds automatically rather than hardcoding their times, and is not a duplicate of this one ...
user avatar
13 votes
5 answers
543 views

What time is it in unicode?

The challenge is simplistic, given an input time as a string in any one of the following formats: hh, hh:mm or ...
Magic Octopus Urn's user avatar