How to Compare system date with mydate in android 2.1?

后端 未结 2 929
攒了一身酷
攒了一身酷 2021-01-05 23:03

in my Android application, i am taking date and time from database. but i am not able to get the date in the \"Date\" Format from the database into my application, the date

2条回答
  •  感情败类
    2021-01-05 23:57

    Try this code:

    Calendar c = Calendar.getInstance();
        System.out.println("Current time => " + c.getTime());
        SimpleDateFormat df = new SimpleDateFormat("dd-MMMM");
        formattedDate = df.format(c.getTime());
    

提交回复
热议问题