Hello Monks!
One of my daily running applications (6am) needs the yesterdays date, or better the date of $param-1day.
Yesterday, sunday, was here in germany the change from 2am to 3am. Running on sunday with date=20100328 it was correct yday=20100327. But I got today with date=20100329 yday=20100327 again.
Code for this:
#!/bin/perl use strict; use Time::Local; die "Wrong parameter count." unless scalar(@ARGV) == 1; die "Wrong parameter format." unless $ARGV[0] =~ /(\d{4})(\d{2})(\d{2} +)/; my @d = localtime(timelocal(0, 0, 0, $3, $2-1, $1) - 86400); printf("%04d%02d%02d", ($d[5]+1900), $d[4]+1, $d[3]);
My question is now how I can fix this issue?
I searched for another module wich help me on this, but Date::Manip have the same problems (reported in "Known Bugs") and Date::Calc have to much dependencies that I have to install, just for task.
Greetings, Schaelle
In reply to Yesterdays date while daylight saving time change by Schaelle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |