mysql to unixtime, how-to in perl
Saturday, November 6th, 2010if you are like me you deal with perl and databases for fun and profit. At some point I needed a function to convert MySQL datetimes to unix seconds since the epoch. Here is one solution in perl: sub mysqltime2unixtime { use POSIX; my $mysqltime = shift; $mysqltime =~ m/(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/; my $year = int($1); [...]


