I haven't used this Perl version of strftime (a C function), but in general convert to gmtime (which takes a trip though Unix Epoch time) and then back to your local time which is what the code above does underneath the covers (or so I think). The time() functions are actually fairly "expensive" in terms of CPU, but unless you have some high performance app, this is the way to go.