How To Obtain The Current Year In Perl Easily

This simple formula will give a Y2K-compliant 4-digit year with low overhead:
1 |
$year = (localtime)[5] + 1900; |
This simple formula will give a Y2K-compliant 4-digit year with low overhead:
1 |
$year = (localtime)[5] + 1900; |
Categories: How-To's, Technology Tags: howto, localtime, perl, tips, Y2K, Year
|
No comments
Copyright © 2005-2025 Eric Michael Stone | Random Thoughts, Whims and Fancies…. Powered by WordPress