Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
We don't bite newbies here... much
 
PerlMonks  

Re: Re: start and end date for a week

by Anonymous Monk
on Dec 01, 2003 at 16:53 UTC ( [id://311411]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: start and end date for a week
in thread start and end date for a week

Granted, this method probably is not by any means optimal considering the simple task at hand but it will give you the results you are looking for.
MySQL's date_format is a frontend to the POSIX function strftime. Use the Perl interface to this instead of MySQL.
use POSIX 'strftime'; # what week is December 1, 2003? # strftime takes month-1 and year-1900 as arguments print strftime("%U",0,0,0,1,11,103); # or use "%V" for weeks starting Monday

Replies are listed 'Best First'.
Re: Re: Re: start and end date for a week
by ChrisR (Hermit) on Dec 01, 2003 at 17:17 UTC
    Thanks for the info. I didn't know about strftime. I'm sure I will find it useful in the future.

    As I said in my original post, I know this is not the right way to do it but it will work. So I lost a little XP for posting a workable yet unworthy answer. At least I gained real experience from it and that's why I come to PM anyway (for experience and knowledge not points or trophies).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://311411]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.