Neulich auf der Perl Golf Liste fand sich folgendes (nur so zum
aufwärmen, bevor wir demnächst die .NET Golfschläger auspacken):
------- Forwarded message follows -------
Subject: [OT] Excel Golf: Unix Time to Excel Time in one line
Date sent: Tue, 26 Oct 2004 13:58:04 +0100
From: "McGlinchy, Alistair" <Alistair.McGlinchy@mark...>
Please excuse the non-perl nature of this question. It's golf coding
question but in Excel not perl so LAMP's in the audience can press
delete now :-). I'm hoping some of you aliens out there have some tips
that could solve a real world problem.
I use Netflow/Flowtools and MRTG/RRD related CSV files that often
contain Unix time stamps (seconds since 1/1/1970 00:00 GMT). I use Perl
and Excel to mung these into something useful. One of the constant
problems is the need to express these timestamps as dates in local time.
I have a native excel formula that works perfectly and is fast, but it
the very nasty side effect of being so long it fills wraps down three
lines to cover's the title rows of my spread sheet. I spent a fair bit
of time golfing my solution but I got stuck a long way off one line:
Write an Excel function that takes a single cell (say "A2") and
converts it into a Excel time (days since 1/1/1900).
You can use any built in excel function
You can't use a VB function, (they are incredibly slow copying
to 64000 rows and Excel isn't smart enough to know when to recalculate
or undo from them);
You can't use hidden columns as temporary variables (I need a
clean import and export to CSV).
I'm assuming GMT/BST as the time zones but I'd like the solution
to be generic enough to applicable to other time zones