Servlet can't get the correct timezone in NAS

my servlet is using the Java TimeZone class to get the current date/time. however, the timezone retrieved is incorrect (GMT+0) -- not the same as the operating system (Unix) timezone.
But the time stamp in the Nas logs displays the correct timezone (for those entries generated by the server and not my application).
any advice greatly appreciated.

We also had a time zone problem with NAS on Unix. We found out that there was a name mismatchs with the time zones of Unix and Java. We solved the problem by forcing NAS to use a different time zone than Unix (or really the same, but with a different name) by modifing the kjs startup script (one of the last lines):
$JAVA_HOME/bin/jre <i>-Duser.timezone=Europe/Paris</i> -mx128m -nojit com.kivasoft.engine.Engine $opts
Regards / Per Huss

Similar Messages

  • Whenever I update my iPhone software, it asks me to sign in to iCloud with an old email address.  My other devices all have the correct address.  How can I get the correct address for my iPhone?  The only Apple ID that works for logging in is my new one.

    Whenever I update my iPhone software, it asks me to sign in to iCloud with an old email address.  My other devices all have the correct address.  How can I get the correct address for my iPhone?  The only Apple ID that works for logging in is my new one.

    To change the iCloud ID you have to go to Settings>iCloud, tap Delete Account, provide the password for the old ID when prompted to turn off Find My iPhone (if you're using iOS 7), then sign back in with the ID you wish to use.  If you don't know the password for your old ID, or if it isn't accepted, go to https//appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Tap edit next to the primary email account, tap Edit, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iPhone on your device, even though it prompts you for the password for your old account ID. Then go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https//appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • I have a Firewire 800 external hard drive and need to connect to my new MacBook Air.  Where can I get the correct cable?

    I have a Firewire 800 external hard drive and need to connect to my new MacBook Air.  Where can I get the correct cable?

    Apple has announced a Thunderbolt to Firewire adapter, but not yet given a release date.

  • Hi, can you help?  My emails that I have received show the date received as either today, yesterday or July 28.  How can I get the correct date received?

    Hi, The emails that I have received show the date received as either today, yesterday or July 28.  How can I get the correct date received?

    That's very scary. They might do it, but I personally have never had Apple contact me re id's except on their site when signing in. I suggest you DO NOT respond until you have a phone conversation with Apple security. They can verify if they sent you the e-mail and why.
    While it's very possible it's true,again, I suggest you not respond until you speak to someone at Apple. I've often read here that when people sign in they are not allowed to because "someone else has used the id" type of statement.
    Also, you should be able to go to the app store and see what apps you have downloaded.
    Though it could have been a free app, have you checked to see if any were bought with your id account?
    I've gotten these types of e-mails from places like USPS and FedEx which look amazingly authentic and were from their website. I also received an odd e-mail from my cousin in Ireland last year that clearly was not from him. It was also sent to others in his family in Ireland. I e-mailed him that I only opened it because it had a .ie, but suggested he change... Days later I received mail from 'him' - same name, but at yahoo.com. 
    Again, I would call Apple. You can also report it at [email protected], but I would not settle for that given your situation. If nothing else, call Apple sales (sales depts. anywhere answer fast) and ask them to transfer you to security. Apple will not want anybody accessing their name, and while it's unlikely, it's not impossible that it is someone phishing.
    Hope this helps and can you let the support community know your results by posting on this thread when you're done? Thank you.
    Hope this helps.

  • Java didn't get the correct timezone

    Hi,
    i have problem with java getting the correct timezone. This problem make me another problem with Oracle who use Java by Enterprise Manager.
    The OS System has the right timezone.
    if i run this w32tm /tz on command, i get
    Time zone: Current:TIME_ZONE_ID_DAYLIGHT Bias: 180min (UTC=LocalTime+Bias)
    [Standard Name:"Argentina Standard Time" Bias:0min Date:(M:3 D:2 DoW:6)]
    [Daylight Name:"Argentina Daylight Time" Bias:-60min Date:(M:10 D:3 DoW:6)]
    But if i create a java file with this procedure
    import java.util.*;
    public class DefaultTimezone
    public static void main(String[] args)
    TimeZone def = SimpleTimeZone.getDefault();
    String id = def.getID();
    System.out.println("default time zone: " + id);
    i run java DefaultTimezone
    i get
    default time zone: America/Rio_Branco
    So, After this i have donwloaded the program tzupdater to fix it
    but this didn't fix anything. The update it's right too.
    Please, Help.!!
    Thanks.

    Yo no say.
    I don't know.
    How close to Brazil do you live?

  • JRockit_160_05_R27.6.2-20 can not get the correct os name for windows 2008

    JRockit_160_05_R27.6.2-20 can not get the correct os name for Windows Server 2008 SP1 using System.getProperty("os.name").
    System.getProperty("os.name") will return Windows Vista instead of Windows Server 2008 when running on Windows Server 2008 SP1. Is it a bug of this jdk?
    I tested it on Sun JDK 1.6. It returns the correct name Windows Server 2008.
    Any suggestion will be welcomed. Thanks in advanced!
    Edited by: user4516182 on May 13, 2010 12:59 AM

    Staffan, thanks for your update.
    Do we have a workaround for it or fix it in new release?

  • I can not get the correct anser

    Hi, Please help me.  As the following sch I can not get the correct sqrt value.  if changing resistor of R1 I always get 12v direct flow output.
    Attachments:
    op_divider.zip ‏121 KB

    Thanks for your answers.  I want the sch to do the operation of square root.
     1. in my sch the inverting input is DC -5v, I want to get the square root of 5?
     2. In my feedback path I use a multiplier, I Originally thought it is a negative feedback?
     3. it Already have ground in the sch, I do not understand that you say "did not ground the scope"?
    Thanks again, Could you give me the further pointing. if possible Could you give me a correct sch.
    (in fact, I get the sch from a rough sch in a textbook(the rough sch not for multisim). I just give the values for the all components)

  • How can i get the correct text from the url which has the mulitp-languages?

    hi, all
    i built a application and deployed it on sun application server 8.1. when i request a url which include some multi-languages (for example http://xxx.com/servlet?value=XXX. the 'XXX' may be simply chinese. ), i got the ??? instead of the correct text. how can i do it? in tomcat server, i can set the URIEncoding=GBK to get the correct code in server.xml. how can i do it in sun app server?
    thanks.

    Ok, it is unclear on what is happening here.
    Are you saying that when the webclient gets the data that it is not honoring the quote characters? Or the processing of the data buffer is causing issues?
    This is what I see the of your example text which is trying to be parse out:
    <a onmouseover="EnterContent('ToolTip','תווית על בגד: &rsquo;&rsquo;תן לאישה לכבס. זה תפקידה&rsquo;&rsquo;','<u><span style=color:#000099;>כתב: Spook בתאריך: 08.03.15 שעה: 22:11</span></u><br>מחאת טוויטר קמה בעקבות תוויות שוביניסטיות שהדפיסה חברת אופנה באינדונזיה לפיהן תפקיד הכביסה מוטל על האישה. החברה התנצלה אך כנראה רק עשתה רק יותר נזק לע...'); Activate();">";
    It appears to me that the  escapes `&rsquo;` does not have matching `&ldquo;` anywhere within the tooltip. So it appears that the page properly places left quotes in when processing the page, but the raw html has broken text.
    Hence a garbage in, garbage out situation.
    William Wegerson (www.OmegaCoder.Com)

  • How can I get the correct Ship To (KNVP-KUNNR2) for a Sales Document?

    I am trying to generate a report that will (among other things) display the Ship To ID and Name for a given Sales Document.  I know the following information:
    VBAK-VBELN - Sales Document
    VBAK-VKORG - Sales Org
    VBAK-VTWEG - Distribution Channel
    VBAK-SPART - Division
    VBAK-KUNNR - Sold To Party
    I know that the table KNVP will return a list of Ship-To Customer numbers (KUNNR2) for a Sold-To Customer (VBAK-KUNNR) if I also filter by VKORG, VTWEG, and SPART (using SE16N).  What I don't know is which one of the returned values is being used in a particular Sales Document.  The customer in question has 29 Ship-To locations.  How do I find out which Partner Counter (KNVP-PARZA) the Sales Document uses? I don't know where that value would come from.  Once I can get the correct Ship-To Customer Number, I should be able to search the table KNA1 by WHERE KUNNR = KNVP-KUNNR2 and return KNA1-NAME1 for the Name of the Ship-To location.

    For a sales document?  Use VBPA with PARVW = 'WE'.  Also, use the ADRDA field to determine whether the address on the document has been manually changed.  In any case, you can use one of the many address management functions or just ADRC directly to get the name, address, etc., using the ADRNR field from VBPA or if the address is from the customer master, KNA1.

  • I can't get the correct node (a real beginner)

    I have an XML file which looks like this:
    [code<lawyer>
         <Country>Singapore</Country>
         <Company>Allen & Gledhill</Company>
    </lawyer>
    <lawyer>
         <Country>Singapore</Country>
         <Company>Allen & Gledhill</Company>
    </lawyer>.
    </Lawyers>
    But I can't get the right node names and values.
    Here is my code:
    File file = new File("lawyers.xml");
    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document doc = builder.parse(file);
    NodeList nlLawyers = doc.getElementsByTagName("lawyer");
    for (int i = 0; i < nlLawyers.getLength(); i++) {
         Element elLawyer = (Element) nlLawyers.item(i);
         NodeList columns = elLawyer.getChildNodes();
         for (int j=0; j<columns.getLength(); j++) {
              Node col = columns.item(j);
              String colName = col.getNodeName();
              String colVal = col.getNodeValue();
              System.out.println(colName + ": " + colVal);
    }What I would like to print out would be something like this:
    Country: Singapore
    Company: Allen & GledhillBut I am getting extra nodes and cannot get the text values. Here is the output I am getting:
    #text:
    Country: null
    #text:
    Company: nullI don't understand this output at all. Please help me get the list of node names and values?
    Thank you.
    -Jeff

    It seems that the #text nodes represent the whitespace between the formal nodes. Also, the nodes that I want to extract have a NodeTypeValue of 1. Once I had determined that I had the correct node, I had to get its child node to get the text. Here is the final code:
    File file = new File("lawyers.xml");
    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document doc = builder.parse(file);
    NodeList nlLawyers = doc.getElementsByTagName("lawyer");
    for (int i = 0; i < nlLawyers.getLength(); i++) {
         lawyer = new Lawyer();
         Element elLawyer = (Element) nlLawyers.item(i);
         NodeList columns = elLawyer.getChildNodes();
         for (int j=0; j<columns.getLength(); j++) {
              Node col = columns.item(j);
              if (col.getNodeType() == 1) {
                   String strColumn = col.getNodeName();
                   Node txt = col.getFirstChild();
                   String strValue = txt.getNodeValue();
                   System.out.println(strColumn + ":\t" + strValue);                         }
         } // for each column
    } // for each lawyer

  • Can't get the correct answers to my security questions

    Can you help me get passed the security questions??  I can't seem to remember the correct answers

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then you can try going to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address then see if the instructions on this user tip helps : https://discussions.apple.com/docs/DOC-4551

  • How can i get the correct text from a string like it show in the original source with the quotation marks in the right place ?

    The text is in hebrew so the problem is that sometimes the quotation marks not in the right place.
    For example i have this text: תווית
    על בגד: ''תן לאישה לכבס. זה תפקידה''
    This is the source original text you can see the quotations marks and they are not in the right place and all i did is copy paste.
    And this is a screenshot of how this text looks like in the website in the original:
    You can see now where the quotations marks should be.
    Now this is how i'm using the text in my program:
    First of all i'm using a webclient to download the page from the website and i'm also encoding it to windows-1255 since it's in hebrew.
    using (var webClient = new WebClient())
    webClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
    byte[] myDataBuffer = webClient.DownloadData("http://rotter.net/scoopscache.html");
    page = Encoding.GetEncoding("windows-1255").GetString(myDataBuffer);
    Then i'm extracting the places i need by reading the html file lines and parsing the right text and it's link.
    string loc;
    List<string> metas = new List<string>();
    List<string> metas1 = new List<string>();
    List<string> lockedLinks1 = new List<string>();
    string text = "";
    string mys = "";
    public List<string> LockedThreads(string filename)
    lockedThreads = new List<string>();
    lockedLinks = new List<string>();
    Regex textRegex = new Regex("ToolTip.*?(?=','<)");
    string[] fall = File.ReadAllLines(filename);
    for (int i = 0; i < fall.Length; i++)
    if (fall[i].Contains("http://rotter.net") && fall[i].Contains("locked")||
    fall[i].Contains("locked_icon_general") ||
    fall[i].Contains("locked_icon_anchor") ||
    fall[i].Contains("icon_anchor") ||
    fall[i].Contains("locked_icon_fire") ||
    fall[i].Contains("locked_icon_sport") ||
    fall[i].Contains("locked_icon_camera") ||
    fall[i].Contains("locked_icon_movie"))
    Regex linkParser = new Regex(@"\b(?:https?://|www\.)\S+\b", RegexOptions.Compiled | RegexOptions.IgnoreCase);
    foreach (Match m in linkParser.Matches(fall[i + 2]))
    if (m.Value.Contains("><b"))
    loc = m.Value.Replace("\"><b", string.Empty);
    lockedLinks.Add(loc);
    string txt = fall[i - 1];
    string text = textRegex.Match(txt).Value.Replace("ToolTip','", String.Empty);
    if (text.Contains("&rsquo;"))
    text = text.Replace("&rsquo;", string.Empty);
    lockedThreads.Add(text);
    Already here on the List lockedThreads you can see the quotation marks not in the right place as in the original:
    After i'm parsing the text and links and adding them to the Lists in another class i'm doing a comparison using this Lists:
    foreach (List<string> l_branch in ListsExtractions.responsers)
    TreeNode l_node = treeView1.Nodes.Add(l_branch[l_branch.Count - 1]);
    if (ListsExtractions.lockedThreads.Contains(l_node.Text))
    l_node.ImageIndex = 0;
    l_node.SelectedImageIndex = 0;
    for (int l_count = 0; l_count < l_branch.Count - 1; l_count++)
    TreeNode l_subnode = l_node.Nodes.Add(l_branch[l_count]);
    if (ListsExtractions.lockedThreads.Contains(l_subnode.Text))
    l_subnode.ImageIndex = 0;
    l_subnode.SelectedImageIndex = 0;
    The problem is in the line:
    if (ListsExtractions.lockedThreads.Contains(l_node.Text))
    When it's getting to the line with the quotation marks it's never equal.
    Now there are more quotation marks.
    In general the problem when comparing both text if it's having quotation marks it's not the same.
    So i have two options:
    1. To fix it somehow so the quotation marks will be the same in both variables when comparing and also the same like in the original as they show in the html page.
    2. To remove the quotation marks from both variables.
    What should i do ? And how ? I was prefer to use the original quotation marks like in the original since they have a meaning in the place they should be. The question is how can i do it ?
    This is example of the block from the html file where the text with the quotation marks is:
    <TD ALIGN="RIGHT" VALIGN="TOP">&nbsp;<font size=-1 color=#ff9933><b>9418</b></font>&nbsp;</TD></TR><TR BGCOLOR="#eeeeee">
    <TD ALIGN="RIGHT" VALIGN="TOP">
    <body onmousemove="overhere()">
    <a onmouseover="EnterContent('ToolTip','תווית על בגד: &rsquo;&rsquo;תן לאישה לכבס. זה תפקידה&rsquo;&rsquo;','<u><span style=color:#000099;>כתב: Spook בתאריך: 08.03.15 שעה: 22:11</span></u><br>מחאת טוויטר קמה בעקבות תוויות שוביניסטיות שהדפיסה חברת אופנה באינדונזיה לפיהן תפקיד הכביסה מוטל על האישה. החברה התנצלה אך כנראה רק עשתה רק יותר נזק לע...'); Activate();" onmouseout="deActivate()" href="javascript:void(0)">
    <img src="http://rotter.net/forum/Images/new_locked_icon_general.gif" border="0"></a></TD><TD ALIGN="right" VALIGN="TOP" WIDTH="55%">
    <FONT CLASS='text15bn'><FONT FACE="Arial">
    <a href="http://rotter.net/cgi-bin/forum/dcboard.cgi?az=read_count&om=189696&forum=scoops1"><b>
    <font color="898A8E">תווית על בגד: ''תן לאישה לכבס. זה תפקידה''</b>
    </a></font></TD>

    Ok, it is unclear on what is happening here.
    Are you saying that when the webclient gets the data that it is not honoring the quote characters? Or the processing of the data buffer is causing issues?
    This is what I see the of your example text which is trying to be parse out:
    <a onmouseover="EnterContent('ToolTip','תווית על בגד: &rsquo;&rsquo;תן לאישה לכבס. זה תפקידה&rsquo;&rsquo;','<u><span style=color:#000099;>כתב: Spook בתאריך: 08.03.15 שעה: 22:11</span></u><br>מחאת טוויטר קמה בעקבות תוויות שוביניסטיות שהדפיסה חברת אופנה באינדונזיה לפיהן תפקיד הכביסה מוטל על האישה. החברה התנצלה אך כנראה רק עשתה רק יותר נזק לע...'); Activate();">";
    It appears to me that the  escapes `&rsquo;` does not have matching `&ldquo;` anywhere within the tooltip. So it appears that the page properly places left quotes in when processing the page, but the raw html has broken text.
    Hence a garbage in, garbage out situation.
    William Wegerson (www.OmegaCoder.Com)

  • Servlet can't get the xmlhttp post request

    hi! i'm new to xmlhttp..i am trying to make a widget that will show the gps info of the device and after that the gps info will be save to mysql..why i can't save the gps info to the database here is my code..
    //function sending request to servlet
    function callback1( result){
    var latitude = result.ReturnValue.Latitude;
    var longitude = result.ReturnValue.Longitude;
    var req = null;
    try {
    req = new XMLHttpRequest();
    if (typeof req.overrideMimeType != "undefined") {
    req.overrideMimeType("text/xml");
    req.onreadystatechange = function() {
    if (req.readyState == 4) {
    if (req.status == 200) {
    } else {
    alert("Error");
    var url = "?d=""&latitude="+latitude"&longitude="+longitude;
    req.open("POST","http://localhost:8080/GPS/location",true);
    req.setRequestHeader("longitude",+longitude);
    req.setRequestHeader("latitude",+latitude);
    req.send();
    } catch (ex) {
    alert(ex);
    location.java
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException {
    response.setContentType("text/html");
    PrintWriter pw = response.getWriter();
    String connectionURL="jdbc:mysql://localhost:3306/loc";
    Connection connection;
    try{
    Enumeration headerNames=request.getHeaderNames();
    while(headerNames.hasMoreElements()){
    String headerName=(String)headerNames.nextElement();
    String headerValue=request.getHeader(headerName);
    pw.println(headerName);
    pw.println(headerValue);
    Class.forName("org.gjt.mm.mysql.Driver");
    connection=DriverManager.getConnection(connectionURL,"root","1234");
    PreparedStatement pst = connection.prepareStatement("insert into loc values(?,?)");
    pst.setString(1,headerName);
    pst.setString(2,headerValue);
    int i = pst.executeUpdate();
    if(i!=0){
    pw.println("<br>Record has been inserted");
    else{
    pw.println("failed to insert the data");
    catch (Exception e){
    pw.println(e);
    --i tried to run my java servlet and it can save already the default headername and value to my repository...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    abcdefhhij wrote:
    hi! i'm new to xmlhttp...Then stop right there. Don't write Javascript code which uses XMLHttpRequest, use one of the Javascript libraries (such as JQuery) which wrap it in a layer of code which deals with all of the horrendous issues with browser incompatibilities.
    It's obvious to me that you have been reading old tutorials. Not only the one about XMLHttpRequest -- which as I said, nobody should be coding to these days -- but also the one about MySQL where it uses a class name for the MySQL JDBC driver which has been outdated for I would guess at least five years. Reading tutorials is an excellent idea, but at least try to find newer tutorials.

  • Can't get the correct return value ?

    Hi,
    I'am using JDBC/ODBC to connect to a MS SQL Server 7 database. I run a stored procedure which updates a table. An update trigger however may rollback the entire transaction and issue a RAISERROR. A return value should be returned after this.
    However, in my servlet, I always retrieve the return value 1 (whether the transaction was rolled back or committed). What am I doing wrong ?
    Forgive me, all you experts out there, I am a beginner ...

    A RAISERROR should produce an exception. Checking the return value shouldn't matter nor be possible.
    What error number is being used for the RAISERROR? I tried different numbers and ended up using the standard 16. Is the trigger returning immediately following the RAISERROR? I remember problems with that, the stored proc would continue if I didn't.

  • ??? Can't Get the Parsed TimeZone (PART 2) ???

    Hi all,
    Sorry about that first post without comments....
    The issue I'm facing is very simple to describe. First, I'm using J2SE 1.4.0_01 on Win 2k.
    I am running the program below in the U.S. Central Time Zone. The date I am parsing is, as you can see, specified in the the U.S. Eastern Time Zone. After the date is parsed, I need a way to determine what time zone the parsed date was specified in.
    I am parsing a date string ("Jul 13, 1997 14:52:16 EDT") using SimpleDateFormat (see below code). Unfortunately, the smart people at Sun decided to make the parse() method return a java.util.Date object instead of a java.util.Calendar object. Why is this bad? Because java.util.Date does not contain time zone information (which is part of the reason it was deprecated in the first place).
    What's more, after parsing the date, the getTimeZone() of the SimpleDateFormat object does not return the time zone from the date that was just parsed, but instead returns the default time zone (i.e., where my JVM is running).
    This just seems so dumb. Am I missing something? Is there a way for me to get at the time zone of the parsed date after the date is parsed? Yes, I know I could read the date string myself and then figure out the time zone and then map the value to the offset from GMT...but you know, the SimpleDateFormat class is ready doing this!
    Sorry for the sarcastic tone -- I'm really getting fed up w/Sun.
    Thanks!
    import java.text.*;
    import java.util.*;
    public class DateTester {
       public static void main(String[] args) throws Exception {
        SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss zzz");
        String s = "Jul 13, 1997 14:52:16 EDT";
        System.out.println("Starting Time Zone: " + sdf.getTimeZone().getDisplayName());
        Date date = sdf.parse(s);
        System.out.println("The parsed date is: " + sdf.format(date));
        System.out.println("Ending Time Zone: " + sdf.getTimeZone().getDisplayName());
       } // main()
    } // DateTester
    Here's the output from running this program in the Central Time Zone:
    Starting Time Zone: Central Standard Time
    The parsed date is: Jul 13, 1997 13:52:16 CDT
    Ending Time Zone: Central Standard Time

    That's a good try but there are two problems:
    First, I can't go around hard-coding the time zone. If I knew the time zone ahead of time (so to speak), I would not have this problem to begin with.
    Secondly, you might think, "Hey, you know the format of the date is "MMM dd, yyyy HH:mm:ss zzz", why not just pluck off the time zone and set it as theh SimpleDateFormat's time zone...like this:"
       SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss zzz");
       String s = "Jul 13, 1997 14:52:16 EDT";
       // Try to pluck off the Time Zone...
       sdf.setTimeZone(TimeZone.getTimeZone(s.substring(1 + s.lastIndexOf(' '))));Well, the problem with this approach is that SimpleDateFormat does not understand "daylight savings" time zones. I don't want to go into too many details but the point is that any daylight-savings time zones (e.g., EDT, CDT, MDT, etc.) will not be recognized as valid time zones and will instead be intrepreted as GMT.
    Thank you again, Sun Microsystems. Fine design -- much better than Microsoft could ever do!

Maybe you are looking for