I had code that parses date as follows:
String ALT_DATE_TIME_FORMAT = \"yyyy-MM-dd\'T\'HH:mm:ss.SSSZ\";
SimpleDateFormat sdf = new SimpleDateFormat(
The question should be where requiredTimeStamp
is coming from and in which format. Is it entered by a user, or read from another program? Which component creates the date in the String representation?
The format "2010-12-27T10:50:44.000-08:00" looks like standardized format ISO-8601
It should be parseable with the pattern yyyy-MM-dd'T'HH:mm:ss.SSSZ
Not sure which settings affect this, but there is an Oracle FAQ about Java TimeZones.
It may be user.timezone
system property or the /etc/localtime
symlink in RHEL.