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

31

1

On most 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 with the current year substituted.


I/O

Input: None.

Output: It's [year] already, folks, go home. with [year] changed to the current year.

Matthew Roh

Posted 2017-04-01T07:04:18.410

Reputation: 5 043

17First test run, got the time instead of the date: It's 8:58 already, folks, go home. – steenbergh – 2017-04-01T09:59:20.923

Can I take input and then ignore it (i.e do something along the lines of String goHome(Object foo){return "It's "+currentYear()+" already, folks, go home.";} (but much shorter, of course))? – user8397947 – 2017-04-01T17:02:23.233

It's a shame I shouldn't compile the challenge to literally: ///, 46 bytes It's the current year already, folks, go home. – Comrade SparklePony – 2017-04-01T17:33:28.383

3@steenbergh If only school was that way in the morning. xD :P – HyperNeutrino – 2017-04-01T21:33:18.040

I feel this challenge would be more appropriate if it were "if it's not the current year, output this, else output nothing", but still good challenge +1 – Tas – 2017-04-03T02:50:49.887

Are we allowed to assume that this will be used on years after 2000 or it has to work on whatever year the target machine may support? – Matteo Italia – 2017-04-03T11:49:10.970

@MatteoItalia Yes, Year will be after the Epoch (1900 on most languages). I mean, come on. It's 2017. – Matthew Roh – 2017-04-03T12:01:25.503

@SIGSEGV: let's make this extra clear: I'm talking about after 2000, not after 1900. My language supports 1980-2099, but I can shave some bytes by assuming the year to be always after 2000. – Matteo Italia – 2017-04-03T12:10:56.893

@MatteoItalia ...No. Please don't assume that. – Matthew Roh – 2017-04-03T12:11:38.400

would this be [tag:kolmogorov-complexity]? – FantaC – 2018-03-03T22:41:45.190

@tfbninja I don't think so... It may only change annually, but the output is not constant, and the program does essentially take input (just, from the system and not the user). – brhfl – 2018-03-07T19:47:16.740

Answers

18

bash + date, 40 bytes

date +"It's %Y already, folks, go home."

Try it online!

fergusq

Posted 2017-04-01T07:04:18.410

Reputation: 4 867

1Also works with ZSH – german_guy – 2017-04-03T12:26:04.650

It works on nearly every shell, but I named it bash because TIO link is bash. – fergusq – 2017-04-03T12:39:06.040

17

C (gcc), 58 bytes

f(){printf("It's%s already, folks, go home.",__DATE__+6);}

orlp

Posted 2017-04-01T07:04:18.410

Reputation: 37 067

19Note you need to recompile this once a year to get the correct functionality. – Robert Fraser – 2017-04-02T06:21:16.430

3@RobertFraser To run any C (gcc) answer on this site you run it as gcc golf.c && ./a.out. That in this process a binary is formed is irrelevant for code golf. My source code is being judged, not the binary being generated (if that was the case my answer would be x86-64). – orlp – 2017-04-02T12:15:06.317

So it's not a C program but a GCC+shell program – Elazar – 2017-04-02T13:45:43.737

@Elazar No, those are just the instructions to run any C (gcc) answer on this site. – orlp – 2017-04-02T15:34:20.673

1True, but this is not "A C program that will produce the desired output" but "A shell command that will produce the desired output" – Elazar – 2017-04-02T18:00:25.083

Its also not a c-Programm because there is no main(). – 12431234123412341234123 – 2017-04-03T09:47:09.680

2@12431234123412341234123 Functions are acceptable answers here on codegolf. – orlp – 2017-04-03T09:57:07.743

@Elazar __DATE__ is standard C, any compiler would work, even in a IDE without a visible shell – Felipe Nardi Batista – 2017-04-03T10:43:24.540

1Nitpickers ... @orlp, since __DATE__[6] is a space, you can spare one byte: ..."It's%s already, folks, go home.",__DATE__+6);} (mind the missing space between It's and %s). – YSC – 2017-04-03T11:50:54.903

My point has nothing to do with standard/nonstandard C. My point is: this is a compile-time (preprocessing time) program, not a C program. The runtime is the C preprocessor + some external execution. – Elazar – 2017-04-03T12:33:37.313

1@YSC What??? Somebody removed that golf from my answer. It was in the original version. – orlp – 2017-04-03T12:39:55.763

Well, "somebody" is OP ^^ They might have thought it was a typo. – YSC – 2017-04-03T12:50:31.507

15

05AB1E, 21 20 bytes

Saved a byte thanks to Erik the Outgolfer

žg“It's ÿˆ§,¹Ò,‚œ€¨.

Try it online!

Emigna

Posted 2017-04-01T07:04:18.410

Reputation: 50 798

1I think you were confusing 05AB1E with Jelly, which has “...» syntax for compressed strings and the » can't be suppressed in any case. – Erik the Outgolfer – 2017-04-01T11:30:05.287

3This is the only solution without readable text :( – boboquack – 2017-04-02T06:47:05.790

1Explanation please? – ckjbgames – 2017-04-02T22:52:51.433

2@ckjbgames built-in dictionary – qwr – 2017-04-02T23:18:40.860

@boboquack Yes, It's is readable. For the rest do this.

– user202729 – 2018-04-12T14:38:03.680

14

TeX (44 bytes)

It's \the\year\ already, folks, go home.\bye

Will Robertson

Posted 2017-04-01T07:04:18.410

Reputation: 141

11

PHP, 42 bytes

It's <?=date(Y)?> already, folks, go home.

user63956

Posted 2017-04-01T07:04:18.410

Reputation: 1 571

Pretty sure you need quotes around the Y. – Micheal Johnson – 2017-04-03T07:57:27.503

3@MichealJohnson PHP will convert unrecogized constants to strings with the same value, so this should work (but it'll throw a notice) – Erik – 2017-04-03T08:19:56.323

7@MichealJohnson You're never sure with PHP – Charlie – 2017-04-03T14:36:28.277

8

Bash, 45 characters

printf "It's %(%Y)T already, folks, go home."

Bash's built-in printf in version 4.2 got the %(fmt)T format specifier and since version 4.3 it defaults to current timestamp in absence of argument.

Sample run:

bash-4.3$ printf "It's %(%Y)T already, folks, go home."
It's 2017 already, folks, go home.

manatwork

Posted 2017-04-01T07:04:18.410

Reputation: 17 865

6

Batch, 45 bytes

@echo It's %date:~6% already, folks, go home.

Batch is actually reasonably competitive for once.

Neil

Posted 2017-04-01T07:04:18.410

Reputation: 95 035

1I guess this solution result varies from different locale settings... – stevefestl – 2017-04-01T11:11:18.447

6

Mathematica, 53 bytes

Print["It's ",Now[[1,1]]," already, folks, go home."]

Martin Ender

Posted 2017-04-01T07:04:18.410

Reputation: 184 808

3Reads like "It's Now already, folks, go home." – Roman Gräf – 2017-04-04T10:25:50.613

5

x86 machine code on DOS - 62 bytes

00000000  b4 04 cd 1a bf 23 01 88  c8 24 0f 00 05 4f c1 e9  |.....#...$...O..|
00000010  04 75 f4 ba 1b 01 b4 09  cd 21 c3 49 74 27 73 20  |.u.......!.It's |
00000020  30 30 30 30 20 61 6c 72  65 61 64 79 2c 20 66 6f  |0000 already, fo|
00000030  6c 6b 73 2c 20 67 6f 20  68 6f 6d 65 2e 24        |lks, go home.$|
0000003e

Even though the input from the BIOS is in BCD (as opposed to the plain 16 bit value got from the equivalent DOS call), decoding it to ASCII turned out to be almost as long as base-10 printing a register. Oh well.

    org 100h

section .text

start:
    mov ah,4
    int 1ah             ; get the date from BIOS; cx now contains the year in packed BCD
    mov di,placeholder  ; put di on the last character of placeholder
lop:
    mov al,cl
    and al,0xf  ; get the low nibble of cx
    add [di],al ; add it to the digit
    dec di      ; previous character
    shr cx,4    ; next nibble
    jnz lop     ; loop as long as we have digits to unpack in cx
    mov dx,its
    mov ah,9
    int 21h     ; print the whole string
    ret

its:
    db "It's 000"
placeholder:
    db "0 already, folks, go home.$"

Matteo Italia

Posted 2017-04-01T07:04:18.410

Reputation: 3 669

4

Ruby, 52 bytes

puts"It's #{Time.now.year} already, folks, go home."

dkudriavtsev

Posted 2017-04-01T07:04:18.410

Reputation: 5 781

4

Python 2, 67 bytes

import time
print"It's",time.gmtime()[0],"already, folks, go home."

Try it online!

ovs

Posted 2017-04-01T07:04:18.410

Reputation: 21 408

4

CJam, 38 bytes

"It's "et0=" already, folks, go home."

Try it online!

Erik the Outgolfer

Posted 2017-04-01T07:04:18.410

Reputation: 38 134

4

Mathematica, 58 bytes

"It's "<>ToString@#<>" already, folks, go home."&@@Date[]&

Anonymous function. Takes no input and returns a string as output. No, I'm not going to make a REPL submission, post it yourself if that one byte is so important.

LegionMammal978

Posted 2017-04-01T07:04:18.410

Reputation: 15 731

3

Perl 6,  53  51 bytes

say "It's {Date.today.year} already, folks, go home."

Try it

say "It's {now.Date.year} already, folks, go home."

Try it

Brad Gilbert b2gills

Posted 2017-04-01T07:04:18.410

Reputation: 12 713

3

TI-Basic (TI-84 Plus CE with OS 5.2+), 64 bytes

getDate
"It's "+toString(Ans(1))+" already, folks, go home.

TI-Basic is a tokenized language. Some commands (getDate, toString(, etc.), and all lowercase letters are two-bytes and everything else used here is one byte each.

Explanation:

getDate                                             # 3, store {Y,M,D} in Ans
"It's "+toString(Ans(1))+" already, folks, go home. # 61, implicitly return required string with Y from getDate

TI-Basic (TI-84 Plus CE with OS 5.1), 108 bytes

{0,1→L1
getDate
Ans(1)L1→L2
LinReg(ax+b) Y1
Equ►String(Y1,Str0
sub(Str0,1,length(Str0)-3→Str0
"It's "+Str0+" already, folks, go home.

TI-Basic is a tokenized language. The more complicated user variables (Y1, L1, L2, Str0), some commands (LinReg(ax+b , getDate, sub(, Equ►String(, length(), and all lowercase letters are two-bytes and everything else used here is one byte each.

OS 5.2 added a toString( command, which obsolesces about half of this submission, which is based off of this algorithm.

Explanation:

{0,1→L1                                  # 8 bytes
getDate                                  # 3 bytes, store {Y,M,D} list in Ans
Ans(1)L1→L2                              # 10 bytes, multiply L1 by the year and store in L2
LinReg(ax+b) Y1                          # 5 bytes, take a linear regression of the points specified by each pair of corresponding coordinates in L1 and L2 and store it in Y1
Equ►String(Y1,Str0                       # 8 bytes, convert Y1 to a string
sub(Str0,1,length(Str0)-3→Str0           # 18 bytes, remove the "X+0" from LinReg
"It's "+Str0+" already, folks, go home.  # 56 bytes, implicitly return the required output

pizzapants184

Posted 2017-04-01T07:04:18.410

Reputation: 3 174

you can inline L_1 in the 5.1 programs. gets rid of a newline, two "L_1" tokens, and a →. 6 bytes saved? – striking – 2017-04-01T21:56:40.610

@striking LinReg(ax+b) uses L_1 and L_2, so I have to set them both. – pizzapants184 – 2017-04-01T22:25:57.710

Save some bytes on the first: use max(getDate) instead because the largest number in getDate is always the year. – lirtosiast – 2017-04-06T18:43:47.163

3

JavaScript ES6, 56 bytes

_=>`It's ${Date().split` `[3]} already, folks, go home.`

Try it online!

const f = _=>`It's ${Date().split` `[3]} already, folks, go home.`

console.log(f())

powelles

Posted 2017-04-01T07:04:18.410

Reputation: 1 277

+1 Exactly the solution I was about to post. You could also use substr(11,4) or slice(11,15) instead of the split. – Shaggy – 2017-04-02T09:57:23.453

Don't you require more than 56 bytes as part the challenge is to output it? – cnorthfield – 2017-04-02T10:30:05.570

3

@cnorthfield Generally speaking in code golf, a function that returns a value is an acceptable answer unless the question has more specific requirements. Check out this and this.

– powelles – 2017-04-02T19:11:05.860

@powelles Thank you for explaining – cnorthfield – 2017-04-02T19:51:58.863

That is true @powelles, but your answer doesn't return anything unless more is added to your golf. – Kyle Fairns – 2017-04-03T12:54:32.983

@Kyle The function returns the string. Functions are acceptable, see the previous links to meta. – grg – 2017-04-03T15:11:22.047

@grgarside I was under the impression that the golf has to be executable as is, and return/display with only the code given - which this answer does not. If this isn't the case, then I'll be on my way. As shown in the runnable code snippet, more is needed to make this actually execute: assigning the function _=>\It's ${Date().split` `[3]} already, folks, go home.`` to a variable const f and calling that function f() in a console.log – Kyle Fairns – 2017-04-03T15:24:48.413

Please read this and this, in addition to the posts linked in my previous comment

– powelles – 2017-04-03T18:12:55.140

“more is needed to make this actually execute” – @KyleFairns, that is callable, all you have to do is to call it: (_=>\It's ${Date().split` `[3]} already, folks, go home.`)()`. – manatwork – 2017-04-04T07:35:15.437

3

PowerShell 3.0, 44 bytes

"It's $(date|% y*) already, folks, go home."

PowerShell is competing quite well today!

Nacht - Reinstate Monica

Posted 2017-04-01T07:04:18.410

Reputation: 481

1This will not work in version 2 of PowerShell (the foreach syntax). So you should have a v3+ identifier on here. Cool other wise. – Matt – 2017-04-03T15:09:59.937

3

Japt, 31 bytes

`It's {Ki} alÎ%y, folks, go Êà.

Try it online!

Tom

Posted 2017-04-01T07:04:18.410

Reputation: 3 078

2

C#, 58 bytes

()=>"It's "+DateTime.Now.Year+" already, folks, go home.";

Anonymous function which returns the required string.

Full program:

using System;

public class Program
{
    public static void Main()
    {
        Func<string> f=
        ()=>"It's "+DateTime.Now.Year+" already, folks, go home.";

        Console.WriteLine(f());
    }
}

adrianmp

Posted 2017-04-01T07:04:18.410

Reputation: 1 592

6I think you can save characters by using C# 6 strings: $"It's {DateTime.Now.Year} etc etc". – Arturo Torres Sánchez – 2017-04-01T16:14:00.233

()=>$"It's {DateTime.Now.Year} already, folks, go home."; 57 – wertzui – 2018-03-09T12:49:55.773

2

Pyth, 38 bytes

s["It's ".d3" already, folks, go home.

Online interpreter.

Erik the Outgolfer

Posted 2017-04-01T07:04:18.410

Reputation: 38 134

Same length: s["It's ".d3d." y\n9?}7Tè+1°Õh6%Ñ< (If you replace \n by an actual newline) link

– KarlKastor – 2017-04-01T17:36:47.373

@KarlKastor How did that work for you? – Erik the Outgolfer – 2017-04-01T18:04:54.283

Don't quite get the question. I used the online interpreter. The algorithm to create pyth's packed ."strings is: +++\.N++hSzeSzCi-RChSzCMz-hCeSzChSzN

– KarlKastor – 2017-04-01T18:10:22.027

@KarlKastor I used that, but it must be something in Chrome, and I highly doubt it's the printable unprintable characters. – Erik the Outgolfer – 2017-04-01T18:14:09.760

2

JavaScript, 77 71 67 63 bytes

alert("It's "+Date().split(' ')[3]+" already, folks, go home.")

Thanks to @programmer5000 for the spaces!

JavaScript ES6 66 60 bytes

alert(`It's ${Date().split` `[3]} already, folks, go home.`)

cnorthfield

Posted 2017-04-01T07:04:18.410

Reputation: 181

Welcome to PPCG! Please golf your answer (remove the spaces around the +s!) – programmer5000 – 2017-04-01T14:18:22.773

1console.log("It's",new Date().getFullYear(),"already, folks, go home.") for 71 bytes – ovs – 2017-04-01T14:18:31.933

@fəˈnɛtɪk reverted back to console.log, added brackets to ES6 alert – cnorthfield – 2017-04-01T17:28:45.227

2

Haskell, 113 bytes

import Data.Time.Clock
f=do t<-getCurrentTime;putStr$"It's "++(fst.span(>'-').show)t++" already, folks, go home."

Try it online! Replace f with main for a full program.

The function getCurrentTime returns a UTCTime object which looks something like "2017-04-02 10:22:29.8550527 UTC" when converted to a string by show. fst.span(>'-') takes the leading characters while they are larger than '-', that is the current year. For the next 7972 years take 4 would work for 8 bytes less, but we want our code to work correctly for ever and ever.

As far as I see build-in functions to get the current year require a import Data.Time.Calendar, so extracting the year from the string should be the shortest option.

Laikoni

Posted 2017-04-01T07:04:18.410

Reputation: 23 676

2

R, 62 59 62 bytes

cat("It's",format(Sys.time(),"%Y"),"already, folks, go home.")

Zahiro Mor

Posted 2017-04-01T07:04:18.410

Reputation: 371

1Using substr(date(),21,24) instead of format(Sys.time(),"%Y") saves three bytes – bouncyball – 2017-04-03T13:51:12.353

does this works in year 20017? – Roman Gräf – 2017-04-04T10:19:54.967

Ahh. Correct. Reverting back. Tnx!! – Zahiro Mor – 2017-04-04T19:58:02.590

2

Befunge-98, 57 55 bytes

"emoh og ,sklof ,ydaerla@ s'tI"4k,y\4*:*/"&2"*+.f7+k,@

Try it online!

Thanks to James Holderness for pointing out my mistake with the sysinfo instruction.

"emoh og ,sklof ,ydaerla@ s'tI" pushes the sentence to the stack where 4k, prints the first word. y is the sysinfo instruction. When passed 20 (the unprintable in the string), it returns 256*256*(year-1900) + 256*month + day of month. \4*:*/"&2"*+. takes just the year from the value and prints it andf7+k, prints the rest of the sentence.

Jo King

Posted 2017-04-01T07:04:18.410

Reputation: 38 234

@JamesHolderness Arghhh, that explains why I've never been able to get sysinfo working. Thanks a bunch! – Jo King – 2018-03-06T23:31:16.460

1

JavaScript ES6, 63 62 bytes

_=>`It's ${new Date().getFullYear()} already, folks, go home`

Luke

Posted 2017-04-01T07:04:18.410

Reputation: 4 675

3Syntax error, you have an extra closing ). – manatwork – 2017-04-01T13:04:12.220

Oops, fixed now. – Luke – 2017-04-02T11:33:05.940

Uhm… I wrote “extra closing )”, not “missing opening (”. ;) – manatwork – 2017-04-03T10:54:29.803

You're right... – Luke – 2017-04-03T15:50:42.247

1

Python 3, 73 68 bytes

import time
print(time.strftime("It's %Y already, folks, go home."))

Very basic answer. The "%Y" gets the current year.

Thanks to @ovs for removing 5 bytes

caird coinheringaahing

Posted 2017-04-01T07:04:18.410

Reputation: 13 702

Save 6 bytes with print(f"It's {time.gmtime()[0]} already, go home") – L3viathan – 2017-06-03T11:49:30.583

@L3viathan thats too similar to the other Python answer – caird coinheringaahing – 2017-06-03T11:50:46.823

1

QBIC, 48 bytes

?@It's `+right$(_D,4)+@ already, folks, go home.

I really should start working on substring...

Explanation:

?       PRINT
@ ... ` String literal: 
        - creates a string with all the text from @ to `, 
        - stores it as the first available string var (A$)
        - and injects A$ at the current point in the QBasic translated code.
+       String concatenation
right$  QBasic function to take characters from the right.
_D      QBIC's call to get the system date as dd-mm-yyyy (_d gets the time)
+@ ...  Second string lit (B$). Doesn't need the closing ` because of EOF.

Update: Substring saves me 4 bytes:

?@It's `+_s_D,-4|+@ already, folks, go home.

steenbergh

Posted 2017-04-01T07:04:18.410

Reputation: 7 772

1

GolfScript, 48 bytes

"It's #{Time.new.year} already, folks, go home."

Try it online!

Yes, this is string interpolation.

Erik the Outgolfer

Posted 2017-04-01T07:04:18.410

Reputation: 38 134

1

MATL, 42 bytes

'It''s '1&Z'V' already, folks, go home.'&h

Try it online!

'It''s '                      % Push this string
1&Z'                          % Push current year
V                             % Convert to string
' already, folks, go home.'   % Push this string
&h                            % Concatenate all stack contents horizontally
                              % Implicitly display

Luis Mendo

Posted 2017-04-01T07:04:18.410

Reputation: 87 464

1

APL (Dyalog), 44 40 bytes

4 saved thanks to Uriel by rearranging the structure

¯5⌽'already, folks, go home.It''s',1⊃⎕ts

Try it online!

Explanation

'alrea ... It''s', ⍝ "alrea .. It's" concatenated with
1⊃⎕ts              ⍝ the first element in the ⎕ts (contains the year)
¯5⌽                ⍝ rotated 5 times to the right

user41805

Posted 2017-04-01T07:04:18.410

Reputation: 16 320

40 - ¯5⌽'already, folks, go home.It''s',1⊃⎕ts – Uriel – 2018-03-04T23:58:29.503

@Uriel Thanks for me getting the crossed out 44 :D – user41805 – 2018-03-07T18:02:02.523

1

IBM/Lotus Notes Formula, 54 bytes

Not exactly challenging but here we go anyway...

"It's "+@Text(@Year(@Now))+" already, folks, go home."

ElPedro

Posted 2017-04-01T07:04:18.410

Reputation: 5 301

1

Java 8, 81 78 bytes

()->System.out.print("It's "+java.time.Year.now()+" already, folks, go home.")

Khaled.K

Posted 2017-04-01T07:04:18.410

Reputation: 1 435

1Don't need the semicolon at the end of a lambda, and either print or printf will be shorter than println. – Pavel – 2017-04-02T23:11:55.797

1

T-SQL, 66 bytes

print concat('It''s ',year(getdate()),' already, folks, go home.')

Nelz

Posted 2017-04-01T07:04:18.410

Reputation: 321

1

SmileBASIC, 65 bytes

Edit: This one should handle years of any size, even though SB (as far as I'm aware) doesn't support any year that isn't 4 characters.

?"It's "+LEFT$(DATE$,INSTR(DATE$,"/"))+" already, folks, go home.

snail_

Posted 2017-04-01T07:04:18.410

Reputation: 1 982

Does this works in year 20017? – Roman Gräf – 2017-04-04T10:20:31.977

1

Javascript, 67 bytes

alert("It's "+new Date().getFullYear()+" already, folks, go home.")

werdna3232

Posted 2017-04-01T07:04:18.410

Reputation: 11

1

Noodel, 34 bytes

Ƈƈy”VẠṇ`DðC1}816ṚĊC:@-~ḂC'^D^#8Ụ İ

Try it:)


How it works

Ƈƈy”VẠṇ`DðC1}816ṚĊC:@-~ḂC'^D^#8Ụ İ
Ƈƈy                                # Gets the current year.
Ƈ                                  # Gets the current time as an integer.
 ƈy                                # Takes the integer and gets the current year from it.

   ”VẠṇ`DðC1}816ṚĊC:@-~ḂC'^D^#8Ụ İ # Creates the string.
   ”VẠṇ`DðC1}816ṚĊC:@-~ḂC'^D^#8Ụ   # Pushes on the string "It's¤ð¤already,¤folks,¤go¤home." as an array splitting on the "ð" character where "¤" is a space.
                                   # (space) NOOP that separates commands.
                                 İ # Concatenate the array using the current year.
                                   # Implicitly print to the screen.

<div id="noodel" code="Ƈƈy”VẠṇ`DðC1}816ṚĊC:@-~ḂC'^D^#8Ụ İ" input="" cols="40" rows="2"></div>

<script src="https://tkellehe.github.io/noodel/noodel-latest.js"></script>
<script src="https://tkellehe.github.io/noodel/ppcg.min.js"></script>

tkellehe

Posted 2017-04-01T07:04:18.410

Reputation: 605

1

Excel, 48 bytes

="It's "&YEAR(NOW())&" already, folks, go home."

Scott Milner

Posted 2017-04-01T07:04:18.410

Reputation: 1 806

1

SmileBASIC, 51 bytes

?"It's ";LEFT$(DATE$,4);" already, folks, go home.

I don't think it's reasonable to ever expect support for 5 digit years, but if SB gets updated in 10 millennia, then this should work for 1 extra byte:

DTREAD OUT Y,,?"It's ";Y;" already, folks, go home.

12Me21

Posted 2017-04-01T07:04:18.410

Reputation: 6 110

1

Aceto, 39 38 + 1 for (-l flag) 40 39 bytes

τ"It's "pp" already, folks, go home."p

Try it online!

Saved one byte thanks to DLosc

τ"It's "pp" already, folks, go home."p
τ                 push local datetime on stack
"..."             push the first part of the string
     pp           print both
       "..."      second part of string
            p     print it

FantaC

Posted 2017-04-01T07:04:18.410

Reputation: 1 425

@DLosc Nice! I'll update – FantaC – 2018-03-04T07:23:27.970

1

SenseTalk, 47 bytes

put "It's"&&the year&&"already, folks, go home"

Allen Fisher

Posted 2017-04-01T07:04:18.410

Reputation: 219

0

Gawk, 64 60 bytes

GNU Awk has a couple of built-in function to get current time and date.

BEGIN{print"It's "strftime("%Y")" already, folks, go home."}

Edit

The script can run from a file (-f), which saves 4 bytes (thanks manatwork).

Maxim Mikhaylov

Posted 2017-04-01T07:04:18.410

Reputation: 571

Actually that is just 60 bytes. The enclosing single quotes and the escape code for single quote are needed only because the shell. You can put the code in a file max.awk and run it as gawk -f max.awk, so becomes clear that only the 60 bytes in the file needs to be counted. (The -f command line option is for free, other command line options would be counted.) – manatwork – 2017-04-03T11:01:17.533

@manatwork I didn't know that -f is free. But it's shorter the way you say it, no matter if it was free or not. I am really confused when counting command line options towards the byte count. Is there a rule or a post that talks about which options count and which don't? I couldn't find it on my own. – Maxim Mikhaylov – 2017-04-03T12:03:14.573

Not a great reading, but we used to point freshmen to On “interactive” answers and other special conditions. Generally, is free whatever is strictly necessary to let the interpreter find the code.

– manatwork – 2017-04-03T12:27:28.750

0

Emacs/Lisp, 70 bytes

(concat "It's " (format-time-string "%Y") " already, folks, go home.")

jad

Posted 2017-04-01T07:04:18.410

Reputation: 11

3You can reduce your byte count by removing unnecessary spaces. – Pavel – 2017-04-02T23:05:43.407

0

VBScript, 53 bytes

msgbox"It's "&year(now())&" already, folks, go home."

ballsy26

Posted 2017-04-01T07:04:18.410

Reputation: 1

You could save 4 bytes by assigning to a variable and 2 more by dropping the parentheses after now, giving you s="It's "&year(now)&" already, folks, go home." (49 bytes). In fact, you can shave 4 more bytes off by just using It's <%year(now)%> already, folks, go home. (45 bytes). – Shaggy – 2017-04-03T11:10:29.163

0

Lua, 59 bytes

Gets the system date

print("It's "..os.date('%Y').." already, folks, go home.")

Ostbullen

Posted 2017-04-01T07:04:18.410

Reputation: 21

0

REXX, 53 bytes

say "It's" left(date(s),4) "already, folks, go home."

idrougge

Posted 2017-04-01T07:04:18.410

Reputation: 641

Does this work in year 20017? – Roman Gräf – 2017-04-04T10:23:22.560

No, it assumes a four-character year. – idrougge – 2017-04-04T11:19:50.430

0

Fourier, 101 bytes

73a116a39a115a32a~S5do32a97a108a+6a101a-4a+3a121a44aSa102a+9~Aa-3a-1a+8a44aSa103a+8aSa104aAa-2a-8a46a

Try it online!

Beta Decay

Posted 2017-04-01T07:04:18.410

Reputation: 21 478

This doesn't have as many 4s as I expected... – Neil – 2017-04-04T00:22:24.430

0

T-SQL 74 bytes

print 'It''s '+CAST(year(GETDATE())as varchar)+' already, folks, go home.'

Appreciate that there is a shorter answer above but in the event that you're in the SQL-Server dark ages and don't have CONCAT available this will work :)

motosubatsu

Posted 2017-04-01T07:04:18.410

Reputation: 121

0

AHK 43 bytes

Send,It's %A_Year% already, folks, go home.

Engineer Toast

Posted 2017-04-01T07:04:18.410

Reputation: 5 769

0

Tcl, 63

No chance of ever winning

puts "It's [clock f [clock se] -f %Y] already, folks, go home."

demo

sergiol

Posted 2017-04-01T07:04:18.410

Reputation: 3 055

0

Forth, 49 bytes

I tried leaving off the trailing " and it worked. Cool.

." It's " time&date . ." already, folks, go home.

Try it online

time&datensec nmin nhour nday nmonth nyear
Report the current time of day. Seconds, minutes and hours are numbered from 0. Months are numbered from 1. - Source

mbomb007

Posted 2017-04-01T07:04:18.410

Reputation: 21 944

0

SQLite, 65 bytes

SELECT"It's "||strftime('%Y','now')||' already, folks, go home.';

Try it online!

Keerthana Prabhakaran

Posted 2017-04-01T07:04:18.410

Reputation: 759

0

Processing.org 48 bytes

print("It's",year(),"already, folks, go home.");

PrincePolka

Posted 2017-04-01T07:04:18.410

Reputation: 653

0

Jekyll, 35 bytes

Jekyll is a static site generator and it's the backend of GH Pages. If only it counts as a language here.

It's :year already, folks, go home.

iBug

Posted 2017-04-01T07:04:18.410

Reputation: 2 477

0

Pyth, 38 bytes

%"It's %d already, folks, go home.".d3

Try it online!

hakr14

Posted 2017-04-01T07:04:18.410

Reputation: 1 295

0

VBA, 56 Bytes

MsgBox "It's " & Year(Now) & " already, folks, go home."

Absinthe

Posted 2017-04-01T07:04:18.410

Reputation: 499

Squash the spaces and save 4 bytes – iBug – 2018-03-07T05:12:59.153

0

VBA (Excel), 42 bytes

Using Immediate Window.

?"It's"year(now)"already, folks, go home."

remoel

Posted 2017-04-01T07:04:18.410

Reputation: 511

0

Attache, 47 bytes

C!DateFormat!"It's %Y already, folks, go home."

Try it online!

This is a constant function that returns the year it was defined in. Alternatively, a function that returns the year it was called in:

{DateFormat!"It's %Y already, folks, go home."}

And for an extra byte:

"It's %s already, folks, go home."%Date[].year|C

or

{"It's %s already, folks, go home."%Date[].year}

Nothing too special going on here in either case.

Conor O'Brien

Posted 2017-04-01T07:04:18.410

Reputation: 36 228

0

Python 2, 90 86 83 78 bytes

from datetime import*;print"It's",date.today().year,"already, folks, go home."

EDIT: Shaved off a couple of bytes.

EDIT: Shaved off more thanks to @HyperNeutrino

Allen Fisher

Posted 2017-04-01T07:04:18.410

Reputation: 219

I can't believe ST beat Python 2... – Allen Fisher – 2018-03-08T02:28:25.487

Not valid. You need to print the "It's ___ already, folks, go home" part. – HyperNeutrino – 2018-03-08T02:28:55.090

D'oh sorry... fixed... – Allen Fisher – 2018-03-08T02:32:26.260

278 bytes – HyperNeutrino – 2018-03-08T02:34:54.433

0

SOGL V0.12, 24 22 bytes

uS"³9n⁶=⅛8!⅔ηεēæ▼∙Ω╝‘⁽

Try it Here!

dzaima

Posted 2017-04-01T07:04:18.410

Reputation: 19 048

0

jq, 52 characters

(48 characters code + 4 characters command line options)

now|strftime("It's %Y already, folks, go home.")

Sample run:

bash-4.4$ jq -nr 'now|strftime("It'"'"'s %Y already, folks, go home.")'
It's 2018 already, folks, go home.

Try it online!

manatwork

Posted 2017-04-01T07:04:18.410

Reputation: 17 865

0

Gema, 63 characters

\A=@subst{<D4>=It's \$0 already, folks, go home.\;?=;@date}@end

Sample run:

bash-4.4$ gema '\A=@subst{<D4>=It'"'"'s \$0 already, folks, go home.\;?=;@date}@end'
It's 2018 already, folks, go home.

manatwork

Posted 2017-04-01T07:04:18.410

Reputation: 17 865

0

jamal, 56 characters

{@format date=YEAR}It's {@date} already, folks, go home.

Sample run:

bash-4.4$ perl jamal.pl year.jam 
It's 2018 already, folks, go home.

manatwork

Posted 2017-04-01T07:04:18.410

Reputation: 17 865

-1

Excel VBA, 44 Bytes

Not sure if this is a cheat... assuming "It's" in in cell A1 on an Excel worksheet and " already, folks, go home." is in A3:

Msgbox Range("A1") & Year(Now) & Range("A3")

Absinthe

Posted 2017-04-01T07:04:18.410

Reputation: 499

1Well, this is . – user202729 – 2018-03-04T10:02:16.870

@user202729 I don't see any technical reason why (https://codegolf.stackexchange.com/tags/code-golf/info). This function takes no inputs as per OPs rules. What do you think?

– Absinthe – 2018-03-04T19:28:51.667