The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
October 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


tried master Matt's suggestions.

Posted by alex on November 07, 2001 at 11:14 PM

i've tried ur suggestion.

1. i tried parsing the dateString to Date object. It doesn't work. the dateString using the SimpleDateFormat works fine.
as i parsed it back to the Date object, the date changed without following my time zone. Since i can't i parse it back to the Date object, the getMonth(), getYear().. etc is rendered useless.

to narrate my point :

part of code:
dateString - follows my timeZone

//parsing dateString back to Date object
ParsePosition pp = new ParsePosition(0);
Date date = dateFmt.parse(dateString, pp);

but 'date' doesn't follow my time zone.

sample output :
dateString : 2001-11-08 1216 // my time
date : Wed Nov 07 12:36:00 PST 2001 //doesn't follow my time

2. i couldn't find any method in the Date class that allows direct manipulation to the timeZone. that is, to define the initialized date according to my time zone.

again, any eccentricity ONLY occurs abberently in JSP.
everything works perfectly fine in JAVA.

so master matt? any ideas? :)

i hope to find a way to evade the 'silly' parseInt() i was using.
maybe u can help. again, i thank u for ur time.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us