Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

How to get the zome from time as EST?

Hi,
I get the date and the time as the following:

java.lang.String geckUpdateDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm Z").format(new java.util.Date());

Open in new window


And it returns me something like:

2011-03-17 00:39 -0400

However I would like to get

2011-03-17 00:39 EST

or

2011-03-17 00:39 EDT

depending on either "Eastern Time" or "Eastern Daylight Time"

How can I make it in Java?

Thanks,
0
Tolgar
Asked:
Tolgar
  • 2
1 Solution
 
for_yanCommented:


Try using lower case "z" or "zzz"
java.lang.String geckUpdateDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm z").format(new java.util.Date());

java.lang.String geckUpdateDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm zzz").format(new java.util.Date());
0
 
for_yanCommented:
Yes, works for me either with one "z" or with three "zzz"
0
 
CEHJCommented:
0
 
objectsCommented:
you just need to specify the appropriate date format string as for_yan has explained above
The capital Z you are using specified RFC822 format which is not what you want
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now