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

K

krislioe

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
 
H

Harry

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top