summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pod/perlfunc.pod8
1 files changed, 2 insertions, 6 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 7973c84d63..b2e9f01bb1 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -3131,15 +3131,11 @@ This makes it easy to get a month name from a list:
print "$abbr[$mon] $mday";
# $mon=9, $mday=18 gives "Oct 18"
-C<$year> is the number of years since 1900, B<not> just the last two digits
-of the year. That is, C<$year> is C<123> in year 2023. The proper way
-to get a 4-digit year is simply:
+C<$year> contains the number of years since 1900. To get a 4-digit
+year write:
$year += 1900;
-Otherwise you create non-Y2K-compliant programs--and you wouldn't want
-to do that, would you?
-
To get the last two digits of the year (e.g., "01" in 2001) do:
$year = sprintf("%02d", $year % 100);