How to convert standard output of date into number of minutes?
I have output from my command as:
Mon Mar 4 12:33:58 2013
and I need to convert it into number of minutes say minutes1
.
because I have a code which gives number of minutes for current time and the code is:
public class DateToMinutes {
public static void main(String[] args) {
Date date = new Date();
long now = ((date.getTime()) / (60000));
System.out.println("Total Minutes are " + now);
}
}
the output of this will be in minutes say minutes2
.
I need to compare both minutes1
and minutes2
.
since I am unable to convert Standard date into minutes1
, it's not possible right now.