|
Here, I wrote this last spring for my User Group: =================================================================== Setting the correct time for Java programs 1) Set the system time - System Value QTIME System Time may already be set on your AS/400. If you need to set it, type: WRKSYSVAL SYSVAL(QTIME) Press Enter. Type a 2 on the option line, press Enter. Key in the current time in your locale. Press Enter. Note: You will need to change this time for Daylight Savings. 2) Set the Time Offset compared to GMT - System Value QUTCOFFSET Time Offset may already be set on your AS/400. If you need to set it, type: WRKSYSVAL SYSVAL(QUTCOFFSET) Press Enter. Type a 2 on the option line, press Enter. Key in the offset for your locale. Press Enter. Note: The offset for PST is -8, MST -7, EST -6. These are the number of hours compared to GMT (Greenwich Mean Time). 3) Set the Time Zone - SystemDefault.properties file The file SystemDefault.properties is not supplied with your OS/400. You have to create it. There are several ways to create this file and enter the time zone setting. Here is one example: A. On your PC workstation, add a network drive to the target iSeries server to the shared root directory (folder). Drill down to the Java400 subdirectory /QIBM/UserData/Java400. Alternatively, use Windows Explorer to access the Java400 subdirectory. B. Open the Java400 subdirectory. Click File-> New-> Text Document. Name the file SystemDefault.txt. C. Rename the file to SystemDefault.properties. Click OK on the warning message window. D. Once the file is on the system in the Java400 subdirectory, open the file with the Windows-provided Notepad (or equivalent) editor. Add the time zone statement as described below. Use the appropriate acronym for your time zone. user.timezone=CST Do not insert a blank on either side of the = character. Save the file, and then exit the editor. Note: This file must have a CCSID of either 819 or 437. If you use the instructions here, it will have a CCSID of 437. For Java programs, you must restart the JVM to use this new property. This means stopping and restarting WebSphere Application Server. Java uses QTIME, QUTCOFFSET, and the user.timezone property together. ======================================================================== ==== -----Original Message----- From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Joe Pluta Sent: Monday, January 12, 2004 8:29 PM To: 'Java Programming on and around the iSeries / AS400' Subject: UTC and the JVM Okay, I'm getting a little kookie here. I have a system value, QUTCOFFSET. If I do NOT set this to -06:00, any updates to the IFS look a little bizarre in Windows Explorer - in fact, any files in the IFS look as if they were updated six hours previously. If I DO change my QUTCOFFSET, the times are fine in the IFS, but now my JVM consistently shows times as being six hours previous (this is actually very weird - if anything, I'd expect them to be six hours LATER). I assume it's because I'm getting the time in my Java program incorrectly; how does one get the time in a JVM when the UTC offset is set? Joe _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/java400-l or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.