how to compare current date and time with another date and time in android
Date date1 = calendar1.getTime();
Date date2 = calendar2.getTime();
if (date1.compareTo(date2) > 0)
{ Log.i("app", "Date1 is after Date2");}
else if (date1.compareTo(date2) < 0)
{ Log.i("app", "Date1 is before Date2");}
else if (date1.compareTo(date2) == 0)
{ Log.i("app", "Date1 is equal to Date2");}
Also in Java:
- gson parse json
- java hashmap get value
- how to cut a certion part from a string in java
- eliminar fila jtable java
- how to convert string to double in android studio
- java execute jar from main
- connect 2 package in android
- funzione random in java
- how to compare current date and time with another date and time in android
- thymeleaf Expression Object dialects
- java sleep in code
- spigot repeating task
- spigot custom mob
- java \t
- how to iterate hashmap java
- testing the web layer without authentication spring
- how to initiate a queue in java
- java android development find element by id
- java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.security.MessageDigest$Delegate
- resurce leak java
- java check if args is empty
- java projects
- throwing exceptions java
- how to get multiple integer input in java