I am working on a project where I have created 2 variables startdate,enddate of type Date in java.
As you know Date in Java includes both date and time.
But while querying I only need the date (specifically day) part of the startdate variable.
I tried startdate.getday() but it says it’s deprecated and I should use Calendar.get(Calendar.DAY_OF_MONTH) instead.
But I don’t know how to use this, tried googling everywhere, the solution is to get the current date.
I want to do something if startdate contains (30/01/1988 02:30:54) so that I get 30/01/1988 or if possible 30 and 01 and 1988 separately in string/int variables.
1 Answer