2 added 330 characters in body
source | link

TSQL, 355 bytes

At the work so no fancy cool languges stick with your SQL Server production server =)

Golfed version

declare @a datetime=getdate(),@b datetime,@d float,@ char(99),@y char(4)while 0=0begin select @b=getdate(),@d=cast(@b as float)-cast(@a as float),@y=' '+DATEPART(y,@b),@=cast(@a as char(20))+' '+cast(@a as char(20))+': 'if @d>=1set @=@+@y+'? You mean we''re in the future?'if @d<0set @=@+'Back in good old '+@y+'.'print @ set @a=@b end

More readable version with minor changes.

declare @t0 datetime = getdate(), @t1 datetime, @d float, @m varchar(99), @y char(4)

while 0=0
begin

    set @t1 = getdate()
    set @d = cast(@t1 as float) - cast(@t0 as float)
    set @y = ' ' + DATEPART(yy, @t1)
    set @m = cast(@t0 as varchar(30)) + ' ' + cast(@t0 as varchar(30)) + ': '

    if @d >= 1 set @m = @m + @y + '? You mean we''re in the future?'
    if @d < 0 set @m = @m +  'Back in good old ' + @y + '.'

    print @m

    set @t0 = @t1
end

SQL is not that bad in respect to timestamps since it's a first class data type.

For the golf's sake we are using a type with 3 milliseconds precision. The loop itself takes less that that to iterate (depending of your server). The key here is internaly that time stamp is a float and the integer type counts how many days passed. It ill work fine in January 1, 1753, through December 31, 9999 date range.

TSQL, 355 bytes

At the work so no fancy cool languges stick with your SQL Server production server =)

Golfed version

declare @a datetime=getdate(),@b datetime,@d float,@ char(99),@y char(4)while 0=0begin select @b=getdate(),@d=cast(@b as float)-cast(@a as float),@y=' '+DATEPART(y,@b),@=cast(@a as char(20))+' '+cast(@a as char(20))+': 'if @d>=1set @=@+@y+'? You mean we''re in the future?'if @d<0set @=@+'Back in good old '+@y+'.'print @ set @a=@b end

More readable version with minor changes.

declare @t0 datetime = getdate(), @t1 datetime, @d float, @m varchar(99), @y char(4)

while 0=0
begin

    set @t1 = getdate()
    set @d = cast(@t1 as float) - cast(@t0 as float)
    set @y = ' ' + DATEPART(yy, @t1)
    set @m = cast(@t0 as varchar(30)) + ' ' + cast(@t0 as varchar(30)) + ': '

    if @d >= 1 set @m = @m + @y + '? You mean we''re in the future?'
    if @d < 0 set @m = @m +  'Back in good old ' + @y + '.'

    print @m

    set @t0 = @t1
end

SQL is not that bad in respect to timestamps since it's a first class data type

TSQL, 355 bytes

At the work so no fancy cool languges stick with your SQL Server production server =)

Golfed version

declare @a datetime=getdate(),@b datetime,@d float,@ char(99),@y char(4)while 0=0begin select @b=getdate(),@d=cast(@b as float)-cast(@a as float),@y=' '+DATEPART(y,@b),@=cast(@a as char(20))+' '+cast(@a as char(20))+': 'if @d>=1set @=@+@y+'? You mean we''re in the future?'if @d<0set @=@+'Back in good old '+@y+'.'print @ set @a=@b end

More readable version with minor changes.

declare @t0 datetime = getdate(), @t1 datetime, @d float, @m varchar(99), @y char(4)

while 0=0
begin

    set @t1 = getdate()
    set @d = cast(@t1 as float) - cast(@t0 as float)
    set @y = ' ' + DATEPART(yy, @t1)
    set @m = cast(@t0 as varchar(30)) + ' ' + cast(@t0 as varchar(30)) + ': '

    if @d >= 1 set @m = @m + @y + '? You mean we''re in the future?'
    if @d < 0 set @m = @m +  'Back in good old ' + @y + '.'

    print @m

    set @t0 = @t1
end

SQL is not that bad in respect to timestamps since it's a first class data type.

For the golf's sake we are using a type with 3 milliseconds precision. The loop itself takes less that that to iterate (depending of your server). The key here is internaly that time stamp is a float and the integer type counts how many days passed. It ill work fine in January 1, 1753, through December 31, 9999 date range.

1
source | link

TSQL, 355 bytes

At the work so no fancy cool languges stick with your SQL Server production server =)

Golfed version

declare @a datetime=getdate(),@b datetime,@d float,@ char(99),@y char(4)while 0=0begin select @b=getdate(),@d=cast(@b as float)-cast(@a as float),@y=' '+DATEPART(y,@b),@=cast(@a as char(20))+' '+cast(@a as char(20))+': 'if @d>=1set @=@+@y+'? You mean we''re in the future?'if @d<0set @=@+'Back in good old '+@y+'.'print @ set @a=@b end

More readable version with minor changes.

declare @t0 datetime = getdate(), @t1 datetime, @d float, @m varchar(99), @y char(4)

while 0=0
begin

    set @t1 = getdate()
    set @d = cast(@t1 as float) - cast(@t0 as float)
    set @y = ' ' + DATEPART(yy, @t1)
    set @m = cast(@t0 as varchar(30)) + ' ' + cast(@t0 as varchar(30)) + ': '

    if @d >= 1 set @m = @m + @y + '? You mean we''re in the future?'
    if @d < 0 set @m = @m +  'Back in good old ' + @y + '.'

    print @m

    set @t0 = @t1
end

SQL is not that bad in respect to timestamps since it's a first class data type