It's time to get rid of C. The language itself is over 35 years old and the standard library is insanely complex. There's even a header file called complex.h, if you need proof. The "stdlib" has even infected pure languages, like Perl.
James' coworker realizes this and is fighting back! As part of his protest against the functions in time.h he's found new and interesting ways to manipulate time in Perl.
The days of time and localtime are limited. One of the easiest ways to figure out now is to just use chop($NOW=`date +%\Y\m%\d`). More interesting is
use Sybase::DBlib; $dbh = new Sybase::DBlib "$user", "$password", "$server"; $dbh->dbuse("dummy"); $query = "select convert(varchar,getdate(),100)"; $ref = $dbh->sql( $query ); foreach $rec (@$ref) { ($today) = @$rec; }
According to James, he uses both of these snippets frequently, often in the same file. Here's to the revolution! (Just don't expect it to be on time.)