in reply to Re^3: sort based on date
in thread sort based on date

JavaFan, you are right.

My date contains only one year.
It wont include Aug 2009 and Aug 2010 at the same time.
The script search through a log file for last 6 months period.


~suhail

Replies are listed 'Best First'.
Re^5: sort based on date
by JavaFan (Canon) on Aug 09, 2010 at 12:01 UTC
    Your example contains a January date, which is more than 6 month ago.

    Note also that for half a year, the previous 6 months will contain dates from more than one year. I presume that if you're running your program in March, you'd want December dates to be sorted before January dates, don't you?

      Right, my example is just a sample code written to demonstrate my requirement.
      I didnt notice January included in that array :(
      And let me clarify my requirement, im looking for a minimal approach of reading my firewall log and make a report with DoS attacker's IP,Threat type, No. of attempts, and Last attempt date.
      I need this report only twice a year.That is, from Jan 2010 - June 2010, Jul 2010 - Dec 2010, Jan 2011 - Jun 2011 so on ..
      I would like to archive my log file after each period.
      So i hope this approach will help me in acheiving my task.


      Thanks very much for your support :)

      ~suhail