Skip to main content

Questions tagged [date]

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

15 votes
10 answers
4k views

Verify a Chinese ID Number The Resident Identity Card (居民身份证) is a document issued to most Chinese citizens. It contains information about its holder, including their name, address, and ID number, an ...
CanonNi's user avatar
  • 259
-4 votes
3 answers
231 views

The RULES Each submission must be a full program. The program takes no input and prints the time in milliseconds until Trump leaves office to the standard output. So pretty much the title. Write a ...
Ramsay Skeet's user avatar
16 votes
12 answers
4k views

You will be provided with a string containing a digital clock. You must determine how many times per day that clock could be correct. You can ignore daylight savings time. You do not know if the clock ...
Ted's user avatar
  • 2,407
17 votes
6 answers
2k views

inspired by this post. Consider 2 coworkers who work Monday - Friday, every week of every year, with no breaks or national holidays. On day n (day, month and year), worker 1 asks worker 2 their ...
Themoonisacheese's user avatar
14 votes
19 answers
3k views

Output (or print) each of the 11 times, one per line, in the POSIX %I:%M:%S format, at which the hour and minute hands of a 12-hour clock are antiparallel. Here <...
Ray Toal's user avatar
  • 821
7 votes
9 answers
2k views

With the passing of ex-president Jimmy Carter, a meme twitter account titled "Did Jimmy Carter Die Today?" erroneously tweeted the usual "No": Some commenters argued that the post ...
Themoonisacheese's user avatar
11 votes
13 answers
2k views

In the United States, Daylight Saving Time starts on the second Sunday of March, and ends on the first Sunday of November. Write the shortest full program, function, or code snippet that does the ...
bigyihsuan's user avatar
  • 11.5k
-1 votes
3 answers
261 views

Given a list of datetime ranges, write the shortest program/function/code snippet that returns a single datetime that is within all ranges, or some falsey value if no such datetime exists, i.e. a ...
bigyihsuan's user avatar
  • 11.5k
22 votes
2 answers
2k views

The task is to find parameters that make a fast leap year check correct for the widest range of years. We assume the Proleptic Gregorian calendar, which extends the Gregorian calendar backward from ...
Falk Hüffner's user avatar
17 votes
13 answers
3k views

The date format varies between countries; the arrangement of date, month and year can be categorized into these three: Year-month-date Month-date-year Date-month-year In Gregorian calendar it's year ...
IY5dVSjABEeV's user avatar
  • 1,307
16 votes
7 answers
5k views

The following data contains the (approximate) population of each UTC timezone in the world (source): ...
enzo's user avatar
  • 2,153
12 votes
10 answers
2k views

Input a datetime, format the datetime in YYYY-MM-DD HH:mm:ss format using 30-hour clock time. The 30-hour clock time works as: After 6 a.m., it is same as 24-hour ...
tsh's user avatar
  • 36.2k
7 votes
6 answers
469 views

Given year, month and optionally weekday of 1st, output the calendar of the month. The first week should remain nonempty. For empty cell, fill it with the date where it's supposed to be, in last or ...
l4m2's user avatar
  • 32.9k
11 votes
3 answers
689 views

Inspired by How do you write dates in Latin? Challenge Given a month-and-day date, output that date in abbreviated Latin, as explained below. Input Input is flexible, following conventions from other ...
Stef's user avatar
  • 997
14 votes
22 answers
3k views

This is the inverse of "Encode the date in Christmas Eve format." Write a program that takes as input the string Christmas, possibly followed by ...
Someone's user avatar
  • 1,262

15 30 50 per page
1
2 3 4 5
20