I use java.util.Calendar to do that. It's really easy to use.
I get the current date and time with a line like this:
Using java Syntax Highlighting
Calendar now = Calendar.getInstance();
Parsed in 0.030 seconds, using
GeSHi 1.0.8.4
I can access the minutes with something like this:
Using java Syntax Highlighting
int minutes = now.get(Calendar.MINUTES);
Parsed in 0.030 seconds, using
GeSHi 1.0.8.4
Hope that helps!