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.

Filter by
Sorted by
Tagged with
16 votes
2 answers
1k views

Fast leap year check

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
16 votes
12 answers
3k views

Is it a date format of YYMMDD, MMDDYY, and/or DDMMYY?

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 ...
鳴神裁四点一号's user avatar
16 votes
7 answers
4k views

How many people are awake?

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

Format Datetime in 30-Hour Clock Time

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
  • 35.1k
7 votes
6 answers
388 views

Output 5-line calendar

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
  • 26.4k
11 votes
3 answers
623 views

Write the date in abbreviated Latin

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
  • 917
15 votes
22 answers
2k views

Decode the date in Christmas Eve format

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,630
18 votes
21 answers
2k views

Last Week Day Of The Month

Introduction This challenge was inspired by a seemingly simple task requested at work that couldn't easily be done in Microsoft Teams. At least not from what we could find! Task Your task, if you ...
Mark Harwood's user avatar
11 votes
6 answers
1k views

Spell date in Japanese

Objective Given a date, spell it out in Romanized Japanese. I/O Format The input format is flexible. The output format is <month spelling> <day spelling>...
Dannyu NDos's user avatar
  • 6,299
24 votes
45 answers
3k views

Output each second

With roughly one second (plus or minus 10 ms) between outputs, output anything. The first output must be at most one second after the start of the program, but can be as soon as right when the program ...
Dadsdy's user avatar
  • 2,095
1 vote
4 answers
288 views

Get the date of the Nth day of week after the Xth day of week in a given year and month

Introduction In the United States, national elections are normally held on the first Tuesday after the first Monday in November. Challenge Write a program that takes a Year as integer, and a pair of (...
Lawrence Sproul's user avatar
9 votes
5 answers
433 views

Next Time Of Given Pattern

Introduction: Some times using a 24-hour clock are formatted in a nice pattern. For these patterns, we'll have four different categories: ...
Kevin Cruijssen's user avatar
20 votes
31 answers
3k views

Which weekday was it?

This challenge, I hope, is simple to understand. Given a date-string (given in any format you prefer, so long as it has 4 digits of year and 2 digits of day and month), calculate the weekday for the ...
SectorCorruptor's user avatar
18 votes
3 answers
867 views

Universal Unicode Clock

Plot contrivance You wake up to find that something has gone horribly wrong! Your time machine has malfunctioned and you are lost sometime between June 2022 and October 1991. You check the computer ...
Wheat Wizard's user avatar
  • 99.6k
5 votes
4 answers
819 views

Which Western Zodiac sign is today?

Task: With the minimum amount of bytes, determine today's Zodiac sign using the programming language of your choice. Rules: This is code golf, the answer with the fewest characters wins. The ...
Crissov's user avatar
  • 439

15 30 50 per page
1
2 3 4 5
19