Search code examples
javatimecalendartimetable

How to link the systems date to app.?


I am trying to create an app that reminds us to do chores on the particular day. I wanna know how to link the date,day and time of the system to the app. For eg: If today is Tuesday, i want the app to automatically change the day from Tuesday to Wednesday tomorrow. Thanks for your help.


Solution

  • You have a couple of selections you could use.

    import java.util.Date;
    Date date=new Date();    
    
    import java.util.GregorianCalendar;
    new GregorianCalendar().getTime();
    

    I personally like the jodatime library. Example use found here