Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I have SuSE 9.3 installed, I applied the timezone-2.3.4-23.9.i586.rpm patch and verified my time on the server is correct. I also updated /etc/locatime with the /usr/share/zoneinf/PST8PDT file (I'm in ...
  1. #1
    Just Joined!
    Join Date
    Mar 2007
    Posts
    2

    SuSE 9.3 DST and Java

    Hello, I have SuSE 9.3 installed, I applied the timezone-2.3.4-23.9.i586.rpm patch and verified my time on the server is correct. I also updated /etc/locatime with the /usr/share/zoneinf/PST8PDT file (I'm in the Pacific timezone for the United States). When the DST changes occured this year, the time updated correctly as the date command is concerened. I have one big problem though and that is java 1.4.2_13 (supposed to be compliant with the new dst changes) is reporting a date of an hour earlier than it is. I'm using this code to check the time:

    import java.text.DateFormat;
    import java.util.Calendar;
    import java.util.TimeZone;


    public class Test1
    {
    public static void main( String[] args )
    {
    DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.FULL,Dat eFormat.FULL);

    Calendar now = Calendar.getInstance();
    // now.add(Calendar.HOUR, 3);
    System.out.println( dateFormat.format(now.getTime()) );
    }
    }

    Anybody know what the problem can be? I can run this test on Windows and the time shows up fine. On a side note, mysql also is reporting the wrong time where as on windows with the same version of mysql, the time shows correctly.

    Please HELP!!!!

  2. #2
    Just Joined!
    Join Date
    Mar 2007
    Posts
    2
    If anybody runs into this, the problem was resolved by running yast -> System -> Date and Time and changing the Hardware clock from UTC to Local Time or Local Time to UTC depending how it was set. Then I had to restart any java processes, and mysql.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...