in reply to How to subtract month without using module?
. . . without using any module.
Who is handicapping you in this way? Do they have any stake in the result?
You'll have to decide whether six months have 182 or 183 days (or 182.62). I'll show two ways of getting a readable time.
The POSIX::strftime() method is the more flexible, so pick it if requirements tend to slip around.my $before_time = time() - 183 * 24 * 60 * 60; print scalar localtime $before_time; use POSIX 'strftime'; print strftime "\n%D\n", localtime $before_time;
After Compline,
Zaxo
|
|---|