![]() ("Subtract one minute from current date : " dateFormat.format(cal.getTime())) ("Subtract one hour from current date : " dateFormat.format(cal.getTime())) ("Subtract one year from current date : " dateFormat.format(cal.getTime())) ("Subtract one month from current date : " dateFormat.format(cal.getTime())) ("Subtract one day from current date : " dateFormat.format(cal.getTime())) ![]() ("Add one second to current date : " dateFormat.format(cal.getTime())) ("Add one minute to current date : " dateFormat.format(cal.getTime())) ("Add one hour to current date : " dateFormat.format(cal.getTime())) ("Add one year to current date : " dateFormat.format(cal.getTime())) ("Add one month to current date : " dateFormat.format(cal.getTime())) ("Add one day to current date : " dateFormat.format(cal.getTime())) ("Current Date Time : " dateFormat.format(cal.getTime())) You can use from bellow code for date and time : DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss") You may find some useful classes here such as Interval, YearWeek, YearQuarter, and more. This project is a proving ground for possible future additions to java.time. The ThreeTen-Extra project extends java.time with additional classes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |