|
Here is an example..........you need to set the time zone.
Mike
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.GregorianCalendar;
/*
* set the time & date
*/
Calendar timenow = new GregorianCalendar();
timenow.getInstance(TimeZone.getDefault());
String DATE_FORMAT = "MMddyyyy";
String TIME_FORMAT = "HHmmss";
SimpleDateFormat dateformat = new SimpleDateFormat(DATE_FORMAT);
SimpleDateFormat timeformat = new SimpleDateFormat(TIME_FORMAT);
dateformat.setTimeZone(TimeZone.getTimeZone("EST"));
timeformat.setTimeZone(TimeZone.getTimeZone("EST"));
----- Original Message -----
From: "Franco Biaggi" <fbiaggi@ticino.com>
To: <JAVA400-L@midrange.com>
Sent: Friday, March 08, 2002 7:27 AM
Subject: Java time on AS/400
> hello,
> running java apps on AS/400 V4R5M0 JDK1.3 the time is an hour before !!!
> The system time is correct and the system value QUTCOFFSET is set correct
(+1);
>
> How to have the correct time on java apps ?
> Is there a Locale to set ? If yes where ?
>
> Thanks.
>
> <html>
>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <meta name="Author" content="Franco Biaggi">
> <meta name="GENERATOR" content="Franco Biaggi">
> </head>
>
> <body>
>
> <p> </p>
>
> <table BORDER="1" COLS="1" WIDTH="452" BGCOLOR="#FFFF00">
> <tr>
> <td width="446"><font face="Comic Sans MS"><small><small><br>
> <font color="#3333FF"><a
href="http://www.ticino.com/usr/fbiaggi/">Franco
Biaggi</a></font><small><br>
> <font color="#3333FF"><a href="http://www.sisa.ch">SISA Studio
Informatica SA</a></font><small><small><small> <br>
> </small></small></small><font color="#3333FF">R&D
Services</font><small><small><small>
> <br>
> </small></small></small><font color="#3333FF">Via Carvina
1</font><small><small><small> <br>
> </small></small></small><font color="#3333FF">CH-6807
Taverne</font><small><small><small> <br>
> </small></small></small><font color="#3333FF">Efax +1 801 705
2839</font></small></small></small><br>
> </small></small></small><font color="#3333FF">Tel. +41 91 935 75
35 Fax. +41 91 935
> 75 30</font></small></small></small><br>
> </small></small></small><font color="#3333FF">Sorry for my bad
english...</font><small><small><small> <br>
> </font></td>
> </tr>
> </table>
> </body>
> </html>
>
>
>
>
> _______________________________________________
> This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
> To post a message email: JAVA400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l
> or email: JAVA400-L-request@midrange.com
> 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-2025 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.