permaculture playing cards
The moose likes Beginning Java and the fly likes Date Format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Date Format" Watch "Date Format" New topic

Date Format

Lim Youjie

Joined: Dec 27, 2004
Posts: 22

may i know how to change the date format to CST of the Date object?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
The Date class has no concept of timezones. You will need to use the Calendar class.
Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
If you require a Timezone aware date implementation you might want to evaluate:

Joda Time

Regards, Guy
Joni Salonen
Ranch Hand

Joined: Jan 07, 2006
Posts: 53
You can set the time zone of a DateFormat object by using the setTimeZone method:
For example:
I agree. Here's the link:
subject: Date Format
It's not a secret anymore!