91
votes
Accepted
How much time is remaining?
Excel, 6 Bytes
=B1-A1
Assuming A is in cell A1 and B is in cell B1
- 11.6k
81
votes
Sleep for 1000 years
C (gcc), 40 36 32 29 26 24 bytes
i;f(){--i&&f(sleep(7));}
Try it online!
-3 thanks to @gastropner.
-1 recursive approach thanks to @AZTECCO.
...
- 7,157
61
votes
Increment The Time
Microsoft Excel, 9 bytes
=A1+"0:1"
Input is in cell A1.
Tested on my Mac (Excel for Mac version 16.53) and online at ...
55
votes
Output the Current Time
Minecraft 1.8.7, 7 + 8 = 15 blytes (bytes + blocks)
Only one command block involved:
xp 1 @p
Output goes to the client console like so:
As part of the normal output.
This is the system:
...
- 11.1k
55
votes
Encode the date in Christmas Eve format
SmileBASIC, 73 71 67 bytes
?"Christmas";
@L?" Eve"*(D!=P);
P=D
DTREAD OUT,M,D
IF M/D-.48GOTO@L
The program prints "Christmas", then ...
- 6,561
44
votes
Sort the months of the year
Jelly, 19 bytes
11ị“bMAanlseovc”iµÞ
This is a monadic link that takes a list as argument and sorts it. Try it online!
Background
Jelly uses modular, 1-based ...
- 208k
42
votes
41
votes
Accepted
When is Thanksgiving?
TI-BASIC, 15 bytes * 0.75 = 11.25
Tested on my TI-84+ calculator
1129-dayOfWk(Ans+ᴇ4,9,1
Thankgiving is November 29, minus the day of the week of September 1st, ...
- 21.3k
41
votes
41
votes
Sleep for 1000 years
Python 3 (Excluding CPython on Windows), 28 bytes
import time
time.sleep(3e10)
Try it online! (Remember to put something in your will so future generations can ...
- 19.4k
40
votes
I'm too cold, turn up the temperature
Minecraft 1.9.0+, 204 162 bytes + 58 36 28 24 20 blocks = 262 240 232 186 182 blytes
This solution is golfed down, and it can't be seen whole in one, or even two screenshots. Uses two glitches and ...
- 833
40
votes
Setting the time
HTML on Google Chrome 67 in Chinese (Simplified), 39 bytes
<input type=time value=00:00 autofocus>
Chrome show different UI component in different ...
- 32.8k
39
votes
I'm too cold, turn up the temperature
Bash + linux utilities, 19
seq 40 2 72|pv -qlL2
seq generates the numerical output. pv ...
- 70.9k
37
votes
Accepted
Stop, stand there where you are!
x86_64 machine code, 10 bytes
Hexdump of the code:
48 69 c9 ca fc 59 38 e2 fe c3
Source code (can be assembled by ml64 of ...
- 12.8k
37
votes
36
votes
How many days in a month?
JavaScript (ES6), 48 47 44 43 42 bytes
m=>31^'311'[parseInt(m[1]+m[2],34)*3%49%8]
Demo
...
- 179k
35
votes
Leap for Leap Seconds!
R, 78 75 bytes
Built-ins, you say? Well...
message(paste(as.Date(.leap.seconds)-1,"23:59:60\n"),"2015-06-30 23:59:60")
R has an automatic variable ...
- 24.5k
31
votes
Advance Happy New Year, 2016!
Mathematica, 45 37 27 24 bytes
#+5[6,6,11][[#~Mod~4]]&
Improvements thanks to @MartinBüttner (10 bytes), and @ChipHurst (a further 3 bytes).
- 1,345
29
votes
28
votes
Automate Saving the World
MUMPS - 30 characters, circa 1966 (ANSI standard first in 1977)
My first attempt at code golf, here we go!
f w "4 8 15 16 23 42" h 6420
MUMPS is still a ...
- 381
28
votes
Sleep for 1000 years
bash, 26 24 bytes
I think part of the challenge here is to not have a signed 32 bit overflow, so:
ping -i86400 -c365243 t.co
The idea here is to make 1000 years of ...
- 711
27
votes
Legen… wait for it…
JavaScript (ES6), 74 bytes
You may want to change your system clock before testing, congratulations if you landed here at 59 minutes past.
...
- 2,554
27
votes
We had a question once which only failed on Sundays
Bash + coreutils, 15 14 bytes
`date|grep Su`
Try it online!
- 208k
27
votes
26
votes
Convert YYYYMM to MMMYY
Python 3, 70 bytes
from time import*
lambda s:strftime("%b%y",strptime(s,"%Y%m")).upper()
This uses the built-in strftime and ...
- 2,222
26
votes
Accepted
Days in indexed month
APL (Dyalog Unicode), 13 12 bytesSBCS
Anonymous tacit prefix function. 0-indexed. February is 29.
31-1∘=+2|7∘|
Try it online!
...
- 29k
26
votes
Accepted
Sleep for 1000 years
MATL, 6 5 bytes
35WY.
This waits for 34359738368 seconds, which is a little more than 1089 years and a half.
Don't try it online!
Explanation
...
- 102k
25
votes
Accepted
Leap for Leap Seconds!
CJam, 72 70 69 64 bytes
26,"~g¼K&Béx¸¦Ø"240bFbf{<1b2md\1972+'-@6X$4*-'-Z3$" 23:59:60"N}
Try it online in the CJam interpreter.
Idea
We start by ...
- 208k
24
votes
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
date × 274code-golf × 263
string × 32
kolmogorov-complexity × 17
number × 15
ascii-art × 14
decision-problem × 9
math × 8
arithmetic × 8
conversion × 7
popularity-contest × 5
primes × 4
sorting × 4
natural-language × 4
array × 4
graphical-output × 3
parsing × 3
palindrome × 3
unicode × 3
pi × 3
interactive × 3
code-challenge × 2
sequence × 2
geometry × 2
random × 2