|Think about Loose Coupling|
Timestamp of last mondayby vibeweb (Initiate)
|on Nov 18, 2011 at 14:10 UTC||Need Help??|
vibeweb has asked for the
wisdom of the Perl Monks concerning the following question:
I'm tumbling with some stats script someone else have made some long time ago, and i need to modify it a bit
The specific part is where the timestamps used in the later database query is set.
In my current code this is defined:
where $start_date returns the current date at 00:00:00 like "20111118000000"
I need to get it to return the date of the last monday (so if the script is run on a monday, it returns the date from the week before).
I've tried various of localtime, tried substract from the $day, but that could result in a negative and so on.