TechnoBuzz

A Techno Blog, mainly about Java

Date

Arron Johnson talks about Dates here

Depracated

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);

Advertisements

July 1, 2005 - Posted by | J2EE

No comments yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: