This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Date Format" Watch "Date Format" New topic
Author

Date Format

Lim Youjie
Greenhorn

Joined: Dec 27, 2004
Posts: 22
Hi,

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

thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41586
    
  54
The Date class has no concept of timezones. You will need to use the Calendar class.


Ping & DNS - my free Android networking tools app
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: http://java.sun.com/j2se/1.5.0/docs/api/java/text/DateFormat.html
For example:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date Format