Thursday, June 13, 2013

How to get previous 7 day Date

Calendar currentDate = Calendar.getInstance();
        Calendar prevDay = (Calendar) currentDate.clone();
        prevDay.add (Calendar.DAY_OF_YEAR, -7);
        System.out.println ("Previous 7 Day: " + prevDay.getTime());

No comments:

Post a Comment

How ChatGPT can Benefit Coding: Your Guide to Leveraging an AI Language Model

 Introduction: Hello, coders! Welcome to this blog post on how ChatGPT, an AI language model, can benefit your coding skills and projects. A...