A Techno Blog, mainly about Java


Arron Johnson talks about Dates here


example of how I deal with dates:

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

Date time = new Date();
String date = sdf.format(time);

GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime (new Date());
int hour = calendar.get(calendar.HOUR_OF_DAY);
int minute = calendar.get(calendar.MINUTE);
int dayOfWeek = calendar.get(calendar.DAY_OF_WEEK);
int dayOfMonth = calendar.get(calendar.DAY_OF_MONTH);
int month = calendar.get(calendar.MONTH);

July 1, 2005 - Posted by | J2EE

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: