Questions tagged [date]
This challenge is intended to be solved by using, manipulating, accepting as input, outputting, or calculating calendar dates or clock times.
279
questions
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 ...
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, <...
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 ...
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 ...
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 ...
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 ...
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.
...
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 ...
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 ...
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 ...
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 ...
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:
...
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 ...
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 ...
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 ...
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 ...
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)
...
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. ...
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 ...
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.
...
-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 ...
-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 ...
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 ...
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 ...
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, ...
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 ...
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 ...
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, ...
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 ...
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:
...
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:
...
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 ...
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
...
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 (...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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....
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 ...
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, ...
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 ...
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 ...
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:
...
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.
...
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 ...
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 ...