DATE in Perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kriz4321
    New Member
    • Jan 2007
    • 48

    DATE in Perl

    Hi
    I need to get ten previous year and month from the current date....
    Is there any perl module which I can use for the same..
    For eg if the date is 2008-07-10
    I nned to get the following output

    2008-06
    2008-05
    2008-04
    2008-03
    2008-02
    2008-01
    2007-12
    2007-11
    2007-10
    2007-09

    So a total count of 10 entries as above .Can you please give some pointers to solve the same....

    Thanks in Advance
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Originally posted by kriz4321
    Hi
    I need to get ten previous year and month from the current date....
    Is there any perl module which I can use for the same..
    For eg if the date is 2008-07-10
    I nned to get the following output

    2008-06
    2008-05
    2008-04
    2008-03
    2008-02
    2008-01
    2007-12
    2007-11
    2007-10
    2007-09

    So a total count of 10 entries as above .Can you please give some pointers to solve the same....

    Thanks in Advance
    I don't know of a module that would do specifically that, but you could definitely write some code to do it. Why not try writing it and if you get stuck, then post the code here (in code tags) and we will help you.

    Regards,

    Jeff

    Comment

    Working...