f



Java applet converting dates to local timezone

We have recently moved a Java applet from one host to another.  Part
of this applet retrieves a date from a CORBA server running on the
host.

We have a problem on the new server where the applet is converting the
returned date to the timezone of the local PC.  As the time portion of
the date is set to 00.00.00 this causes the date to change in
locations that are behing GMT (our server is in London).

For example if the server returns 18th October 00.00.00 GMT, the
applet running on a PC in New York displays 17th October (behind the
scenes it has converted to EST).  The mystery is why this has started
happening when we moved to a new server, the code is identical and
there a no major differences in the webserver (iPlanet) config.

Anyone any ideas?
0
10/15/2004 11:22:14 AM
comp.lang.java.help 13340 articles. 0 followers. Post Follow

2 Replies
317 Views

Similar Articles

[PageSpeed] 45

Can you post the date parsing block of your applet?

Do both hosts (old and new) run the same VM?


0
schools_ring (242)
10/15/2004 2:30:46 PM
Michael Elliott wrote:

> We have recently moved a Java applet from one host to another.  Part
> of this applet retrieves a date from a CORBA server running on the
> host.
> 
> We have a problem on the new server where the applet is converting the
> returned date to the timezone of the local PC.  As the time portion of
> the date is set to 00.00.00 this causes the date to change in
> locations that are behing GMT (our server is in London).
> 
> For example if the server returns 18th October 00.00.00 GMT, the
> applet running on a PC in New York displays 17th October (behind the
> scenes it has converted to EST).  The mystery is why this has started
> happening when we moved to a new server, the code is identical and
> there a no major differences in the webserver (iPlanet) config.
> 
> Anyone any ideas?

I just have one question. Why is this a problem? Is the application not
showing the correct local time? If you really want the local machine to
show GMT, why don't you change the time zone on either the local machine
proper, or within your application?

In other words, tell us:

1. What you want.

2. What you are getting instead.

3. How one differs from the other.

-- 
Paul Lutus
http://www.arachnoid.com

0
nospam248 (2592)
10/15/2004 3:50:47 PM
Reply:

Similar Artilces:

Converting java.util.Date to java.sql.Date
Hello Friends In my program i am using the following codes: Date today = new Date(); log.debug("today is"+today); SimpleDateFormat fmt = new SimpleDateFormat("yyyy-mm-dd"); String todayStr = fmt.format(today); log.debug("todayStr value"+todayStr); java.sql.Date dt = java.sql.Date.valueOf(new String(todayStr)); log.debug("current Dt is:"+dt); The output iam getting is like this: today is Sat Sep 09 19:20:13 IST 2006(from java.util.Date) todayStr value 2006-20-09(from string value) current Dt is: 2007-08-09(from java.sql.Date) So h...

Convert java.util.Date to java.sql.Date
I convert java.util.Date to java.sql.Date this way:java.util.Date utilDate = new java.util.Date();java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());And then send sqlDate to prepareStatement.ps.setDate(1, sqlDate).But I got the date such as dd-mm-yyyy. And I need also take hours,minutes pm(am).How can I get the Date "dd-mm-yyyy hh:mm a"? Bumsys@gmail.com wrote: > I convert java.util.Date to java.sql.Date this way: > > java.util.Date utilDate = new java.util.Date(); > java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime()); > > And then send sqlD...

Help!!! Applet Designer 3.0 trial VB->Java applet converter
Hi, Has anybody Applet Designer 3.0 trial? I lost it somewhere and now it can be very helpful. ad30.exe file about 3MB. thanks in advance Hania try: http://www.diamondedge.com/products/Convert-ASP-to-JSP.html "HD Warszawa" <zlecenia@poczta.neostrada.pl> wrote in message news:bulugh$kt7$1@atlantis.news.tpi.pl... > Hi, > Has anybody Applet Designer 3.0 trial? > I lost it somewhere and now it can be very helpful. > ad30.exe file about 3MB. > thanks in advance > Hania > > Thanks a lot. Unfortunately JSP is not a Java applet, I need an older version ...

Java in Java
Is it possible to download a Java app (applet etc?) and run it inside a desktop Java app? -- Dirk http://www.transcendence.me.uk/ - Transcendence UK http://www.theconsensus.org/ - A UK political party http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff Dirk Bruere at NeoPax wrote: > Is it possible to download a Java app (applet etc?) and run it inside a > desktop Java app? > Quite likely, but you won't necessarily get the same security model, unless you were careful about it. -- Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/&g...

java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException
Hi, I am new to DB2. I am getting this error while loading the DB2Driver. I don't have any idea about where i might have gone wrong. please help me. Below is the stack trace. Stack Trace: java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException at COM.ibm.db2.jdbc.app.DB2Driver.SQLAllocEnv(Native Method) at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.java:245) at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(DB2Driver.java:130) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) Thanks in advance, Ganesh Majji ganesh.m@gmail.com wrote: > I am new to DB2. I am getting this error while loading the DB2Driver. I > don't have any idea about where i might have gone wrong. please help > me. Unfortunately my crystal bowl stays dark because you didn't mentioned your operating system and which DB2 version you're using. For Windows, *nix and OS/2 please ensure that your application is using the db2java.zip from SQLLIB\java. Check if there are multiple db2jdbc.dll on your system, remove any extra db2jdbc.dll files on the system. Ensure that you can connect to DB2 with the DB2 workstation tools from your machine. sorry for not mentioning the system details. Operation System is SunOS (Solaris) and DB2 SDK 8.2.2 Thank you very much for the kind response, Ganesh Bernd Hohmann wrote: > ganesh.m@gmail...

Java Java
Have my first Open Source Linux Java Project. Working on a second right now. Coming out with a distro called OPEN*WINDOWS. It will be at www.black-and-company.com tab wrote: > Have my first Open Source Linux Java Project. > Working on a second right now. > > Coming out with a distro called OPEN*WINDOWS. > > It will be at www.black-and-company.com > Wasn't that the whole point of Lindows? Oh, right, we didn't care for that either. tab wrote: > Have my first Open Source Linux Java Project. > Working on a second right now. > > Coming out with a ...

convert date in different timezones into default timezone, getting Exception in thread "main" java.text.ParseException:
Hi, I am reading different files and extracting date out of them . But dates are appearing to be from different timezones ( or from different countries ) , hence I am receiving CODE Exception in thread "main" java.text.ParseException: Unparseable date: " maandag 19 november 2001 5:48" while parsing String of date to Date Object . The code I am using is CODE SimpleDateFormat dateFormat = new SimpleDateFormat(" EEEE dd MMMM yyyy HH:mm"); dateFormat.setTimeZone(TimeZone.getDefault()); date = dateFormat.parse(strDate); T...

java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460)
Hi All I am having the torque3.1.jar and postgresql-7.4. I have compiled the new jdbc driver called as postgresql.jar and have placed it in the lib directory from where the ant scripts catch the jars. Whenever i try to access through torque gestList = BaseGestlistPeer.doSelect(new Criteria()); this error arises java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460) at org.postgresql.jdbc2.ResultSet.toTimestamp(ResultSet.java:1653) at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java...

warning: [deprecation] in java.util.Date(java.lang.String) has been deprecated
Dear Java Programmers, When compiling my Java program I get the following warning: "warning: [deprecation] in java.util.Date(java.lang.String) has been deprecated" on for example this statement: new Date("09/23/2003") The code is used to generate the dates on a webpage. Depending on the language of the webpage the generated format is different. For example English (see "Date" and "Choose publication" on the page opened): http://home.scarlet.be/kenya-belgium/list_5_en/a_kenyan_birthday_party_and_a_belgian_birthday_party.html French: http://home.scarlet....

NEWBIE HELP! java.lang.NoSuchMethodError Applet
Hi all, im fairly new to the java world and need some help sorting an applet problem im having. Ive developed an applet that reads in xml files from the web - which works fine with appletviewer in eclipse, and the applet itself works locally when it doesnt use the xml files. However, when i try to run it in a web browser it just stays grey and the java console reports: java.lang.NoSuchMethodError: com.esp.control.ESPCentralProcess.generateCourseData()Ljava/util/ArrayList; at com.esp.gui.ESPStartUp.start(ESPStartUp.java:219) at com.esp.gui.JPanelManager.panelAdd(JPanelManager.java:151) at...

XML-RPC
Hello, I am getting an error "XML-RPC - java.lang.ClassCastException: java.util.Date" when I call the "XmlRpcClient" execute method. I believe the underlying classes are having trouble parsing the result from the time.xmlrpc.com/RPC2:80 XML-RPC service. I apologize that I could not navigate the Apache bug reporting and search system. I hope someone can recognize what is up with this. Thank you in advance for any help, Michael import java.util.Vector; import java.util.Hashtable; import org.apache.xmlrpc.*; public class GetTime { private final static String serv...

(Again) java.util.Date vs java.sql.Date
Hi there, (Again) Im trying to understand the EXACT difference between java.util.Date vs java.sql.Date. Googling, I can see that this is a very "popular" subject, but I still cannot figure out it exactly. Many writers claim that java.sql.Date only stores the DATE part (yyyy- mm-dd) but not the TIME part (hh:MM:ss) of a Date/Time value, but that I can easily disprove: java.util.Date ud = new java.util.Date(); java.sql.Date sd = new java.sql.Date(ud.getTime()); System.out.println(DateFormatUtils.format(ud, "yyyy-mm-dd hh:MM:ss.SSS")); System.out.println(DateFormatU...

Cast from java.util.DATE to java.sql.DATE
DB ORACLE Calendar stCal = Calendar.getInstance(); stmt.setDate(COLUMN_DATA, stCal.getTime()); doesn't work because setDate method Sorry for the first post.... DB ORACLE Calendar stCal = Calendar.getInstance(); stmt.setDate(COLUMN_DATA, stCal.getTime()); doesn't work because setDate method (int, java.sql.Date) in the type PreparedStatement is not applicable for the arguments (int, java.util.Date) If I try with: stmt.setDate(COLUMN_DATA, (java.sql.Date)stCal.getTime()); I obtain a class cast exception Any solution? How can I insert a java.util.date obtained from a calendar object in a Oracle DB (java.sql.Date)? thanks in advance Dom On 01.02.2005 12:36 Dom wrote: > > Any solution? How can I insert a java.util.date obtained from a calendar > object in a Oracle DB (java.sql.Date)? > Calendar stCal = Calendar.getInstance(); java.util.Date utlDate = stCal.getTime(); java.sql.Date sqlDate = new java.sql.Date(utlDate.getTime()); stmt.setDate(COLUMN_DATA, sqlDate); Thomas "Thomas Kellerer" <NNGNVRDSJEBN@spammotel.com> schrieb im Newsbeitrag news:3698dfF4v06i6U1@individual.net... > > > On 01.02.2005 12:36 Dom wrote: > > > > Any solution? How can I insert a java.util.date obtained from a calendar > > object in a Oracle DB (java.sql.Date)? > > > > Calendar stCal = Calendar.getInstance(); > java.util.Date utlDate = stCal.getTime()...

Java to Forth converter? ( was Re: Java to Forth converter? )
Is possible, to my understanding, IBM, SUN, Microsoft should be very happy to help with the assimilation, not. Java byte code is the key. many simularities, however, because no registers are used, --> the good, clean functional programming, clean return stack usage enforced thru Java bytecode compilers --> the bad, mapping functions, array iteration is slow, DSP work non competative, several 'weird' java byte code instructions to 'make up for' lack of direct register/optimize substituting only a parameter stack, First one to build a Java to Forth converter owns IBM....

Convert windows TimeZone to Java TimeZone
Hi, My application works on a multi tier architecture - web server and application server run on different machines. I'm trying to get the (remote) MS IIS web server (does not have JRE) time zone ID. How can I convert the web server Windows time zone ID to a Java time zone ID in the application server (runs Java of course)? is there any String I can render to a well formed Java time zone ID ? Or is the only solution to set a hash set pairs of windows timezone and Java time zone id. thanks, Asaf asaf wrote: > > How can I convert the web server Windows time zone ID to a Java time...

Job to convert Java App 1.3.1 to Java Newest of Java
I am looking for a excellent and fast developer to convert my existing Java program using (1.3.1) to the newest version of Java. The program uses Graphics and database routines. Review web site http://www.uprealimager.com For those developers interested in a small conversion project please reply for additional details. Thank you, Michael Kintner, MCSE, MGP CEO, Business Network Developer CNerd Inc 518 Queen Street Olean, New York 14760 ...

java.lang.Set with elements of type java.lang.Set
Roughly I do something along the lines of: Set set = new HashSet(); Set elem = new HashSet(); set.add(elem); // now we change the elem and add it again to the set elem.add(some object here); set.add(elem); I found out the hard way that 'set' may now contain 'elem' either once or twice, the reason being that 'elem.add()' changes the hashCode of elem such that it is not noticed that it is in 'set' already on the 2nd 'set.add()'. Question: What I would actually want is an IdentityHashSet() set = new IdentityHashSet() but this does not...

Java applet failed when I try to load the avi file in my java applet
Hi everyone, I am a new person in Java and JMF. I tried to use HTML to run the class of the SimplePlayerApplet.java that is posted in java.sun.com. html: <applet code=SimplePlayerApplet.class width=320 height=300> <param name=file value="sun.avi"> I got a java applet failed. I am not sure where should i put the sun.avi file? The SimplePlayerApplet.class and sun.avi are in my desktop. Is it right as <param name=file value="sun.avi">? Sometimes, i will see people write as <param name=file value="file usr/local/media/sun.avi">?? Where is ...

to use import java.lang.* or import java.lang.Math or none at all?
Hi guys, i knew that by default all java.lang classes will be imported by the compiler during compilation. but, to make it easier for the computer, should i specify which class i really will be using? does this action will boost the performance during compilation and runtime or not a matter at all? the answer to this post will definitely affect my programming style in the future when i'm considering "to import or not to import"... hmm,,, thanks in advance. JPractitioner wrote: > i knew that by default all java.lang classes will be imported by the > compiler during compilation. but, to make it easier for the computer, > should i specify which class i really will be using? does this action > will boost the performance during compilation and runtime or not a > matter at all? Whether and how you import classes has exactly zero effect at runtime. Imports (with or without wildcards) are only a kind of abbreviation provided by the compiler to save us the effort of typing in fully-qualified type names every time. In theory explicit importing should make compilation faster -- by a very tiny amount. I've never heard anyone claim that they've even managed to measure a difference let alone found a case where it made a practical difference. So the question comes down to how to write your code for maximum clarity. One school of thought asserts that you should always import each class explicitly (rather than by a wildcard). There's a fai...

modifying java.lang.String.java
Hi, I'm trying to modify java.lang.String.java and add the modified String.class to rt.jar [THIS IS FOR MYSELF ONLY AND WILL NOT BE DEPLOYED]. I cannot add "private final boolean tainted[] = new boolean[5];" to String.java. If I do, it still compiles and I can add it to rt.jar and compile a test program against it. However, the JVM crashes with a strange message: java.lang.IllegalArgumentException: name can't be empty at java.security.BasicPermission.init(Unknown Source) at java.security.BasicPermission.<init>(Unknown Source) at java....

Ruby to java or java to ruby converter
hi, am a newbie to ruby and was wondering whether there is any ruby2java or java2ruby converter? we are planning to compare both the languages based on some benchmarks..so thought a converter would come in handy. any suggestions? thanx, vinod -- Posted via http://www.ruby-forum.com/. From: "Vinod Kone" <vinodkone@yahoo.com> > > am a newbie to ruby and was wondering whether there is any ruby2java or > java2ruby converter? we are planning to compare both the languages based > on some benchmarks..so thought a converter would come in handy. any > suggestions? ...

Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object
Good day to all, I have installed the j2se/netbeans binary bundle on red hat 9. I can run everything perfectly as root but when I try to compile with any other user I get: Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object When I saw this it seemed like a permissions problem but I checked the permissions and everything seemed fine. All users have execute permissions of javac and java. I have read other threads dealing with the same or similar problem but have not reached any solution yet. I would appreciate if anyone that has run into this type of problem and has solved it if he/she could give me a hand or if anyone could just point out what I should be looking for in this type of problem. Thanks in advance... gek ...

Why no Java applets in (Java-enabled) Safari???
I'm at wits end here. Applets work fine in Firefox, but not in Safari. "Enable Java" is checked in my Safari's Preferences > Security, and there's a "Java Applet.plugin" in Library/Internet Plug-Ins. Still, according to what I see at http://www.w3.org/People/mimasa/test/object/java/clock my Safari can't handle Java applets at all; all I see is the "cup of coffee" graphic that indicates that Java is not available. (FWIW, the page above displays correctly when I use Firefox.) I've run out of troubleshooting ideas. What's the next...

How fast is an Java Application to a Java Applet.
I have 2 Questions.1. I have a applet which works slowly. If I turn it into Application.How fast will it run. Currently it works on JVM. Will it be 10-20times faster if the Applet is converted into application?2. Java Applet works on all Browsers. I want all users to run myApplication Will I need to provide J2SE along with my application.3. How many computers have Java already installed?ByeSanny Sanny wrote:> I have 2 Questions.Or maybe 3,> 1. I have a applet which works slowly. If I turn it into Application.> How fast will it run. Currently it works on JVM. Will it be 10-20> times...

Web resources about - Java applet converting dates to local timezone - comp.lang.java.help

PastBook’s Filepicker.io Integration Eases Process Of Converting Facebook Content To Books
PastBook , one of several companies that allow Facebook users to publish their content on the social network in actual books , announced the ...

Facebook No Longer Converting Groups Into Pages
Back when Facebook first launched Facebook Pages, many businesses and brands who had built up substantial audiences in their Facebook Groups ...

Zwartz Laminating-Converting B.V. on the App Store on iTunes
Get Zwartz Laminating-Converting B.V. on the App Store. See screenshots and ratings, and read customer reviews.


"Occupier" Thanked Former Soviet Citizen for "Converting" Him to Capitalism, Pro-Israel, Pro-USA - YouTube ...
May Day Demonstration on Union Square in New York City Zionism & Birth of Modern Israel in 1948: Former Soviet Citizen Pays Tribute to Ben-Gurion ...

Converting dry air to water: solution to Broken Hill's water crisis gains support
A one-man crusade by a Broken Hill resident to solve the historic town's water crisis by introducing air to water converters is gaining support. ...

Click go fears of converting print files
Is there a way to convert a print queue item to a .RTF or .PDF file? I like to save or email them. - The Sydney Morning Herald

Sudanese woman ordered to hang under sharia law for converting to Christianity gives birth
Khartoum, Sudan: A Christian Sudanese woman sentenced to hang for apostasy has given birth in jail, a Western diplomat said on Tuesday.

Imams warn against radicalism to Aboriginal inmates converting to Islam
The prison system has enlisted the help of ASIO to crack down on radicalisation behind bars amid revelations that Aboriginals are converting ...

Converting the world's companies one by one - The Science Show - ABC Radio National (Australian Broadcasting ...
Image: Trucks carrying logs make their way up a road in Jambi, Indonesia. A vast area of the Sumatran forest, and orangutan habitat, is being ...

Resources last updated: 3/9/2016 10:28:44 PM