Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

Where to set date format that affect Date.toString() ?

Thread view: 
krislioe@gmail.com - 09 May 2007 07:33 GMT
Hi all,

The result of Date.toString() in my applications differs on two
computers. We use win XP sp 2.
Below are the difference :

Wed May 09 00:00:00 GMT+07:00 2007

Wed May 09 00:00:00 ICT 2007

I go to Control Panel, but even in Regional Setting I can not find the
place where to set it.
Where is it ?

Thank you for your help,
xtanto
Harry - 09 May 2007 09:30 GMT
Hi,

I'm not sure whether you can set in Regional Setting, but as you see,
it will defer based on different computer settings. So, why don't you
use the utility provided by JAVA to format your date output, so you
can see the same result even on different computer.

Use class SimpleDateFormat is a good choice.

SimpleDateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss
yyyy");
df.format("new Date()");

Harry

On May 9, 2:33 pm, krisl...@gmail.com wrote:
> Hi all,
>
[quoted text clipped - 12 lines]
> Thank you for your help,
> xtanto


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.