Problem with the Java Web Application

Hello

I have a web application.
The web server is in the time zone CST and the DB server in zone PDT.
When we input a date of the browser say '2011-09-26 + 05:30 ' we who convert in milliseconds and save in DB, which is 1316975400000 for the example above.

When we have to be back the date that we convert milliseconds to date to end of server that is in the time zone PDT and ends in "25/09/2011.

A Solution I found when I did was:
"To pass a Date and a time zone; Jet lag, we stayed was the time zone by default for the customer. On the side server, we have shaped the date by using the zone passed from the client is not using the server's default time zone. »

Please let me know if it is the ideal solution, or there at - it another way to do it.

It is a general problem and responded to many forums. But still I wanted to check if there is another solution for this.

Thank you

828549 wrote:
Please let me know if it is the ideal solution, or there at - it another way to do it.

Yes: Do not save the zone at all; It simply adds unnecessary objects. And do not convert to milliseconds first. Simply store the date as a SQL Date or Timestamp.

Java dates, and most date from database, I know, are stored as compensation from a point fixed in time ( same point anywhere in the world) then, unless you use a very obscure (and non-standard) database, the JDBC driver must be able to convert a java.sql.Date in internal format of the database without any problems.

Then, when you want, just use the normal methods of the db for the display. They will take care to display the correct time for the local time zone.

Winston

Tags: Java

Similar Questions

  • Support for Arabic characters - problem with the .java resource group

    Hi all
    I have a requirement to internationalize the web application from merger and support Arab characters

    I have a file of properties in the project view controller and a .java resource group in the model project.

    I followed the steps mentioned in the documentation
    Regardless of the text defined in the .properties file works fine, the problem is with the .java resource group. The characters defined in the java file is
    shown on the Web page, as follows.

    O´UŠO³O¨ O´UŠO´O¨O´UŠ

    What could be the reason. Can someone help me on this?



    Jdev version 11.1.2.0.0

    And you can also try like this,

    My locale in backing bean file is like this

    Locale bean

    public class LocaleBean {}

    language of the public channel = 'en ';

    /**
    * @return
    */

    {} public void changeLocale (language: String)
    System.out.println ("changeLocale" + language);
    This.Language = language;
    this.setLanguage (language);
    Locale newLocale = new local (this.language);
    FacesContext context = FacesContext.getCurrentInstance ();
    context.getViewRoot () .setLocale (newLocale);
    JSFUtils.storeOnSession ('LOCAL', language);
    System.out.println ("end of change of locale");
    }

    {} public void setLanguage (language: String)
    This.Language = language;
    }

    public String getLanguage() {}
    return language;
    }

    {} public void changeLocaleAction (ActionEvent actionEvent)
    changeLocale (this.language);
    Add the code in the event here...
    }
    }

    Faces - config.Xml




    Oracle.ADF.Rich

    Resorces.XX
    message


    en
    AR
    en



    localeBean
    LocaleBean
    request

    and my package of resource like this:

    xx_ar_AR. Properties
    XX. Properties

    And the project properties > compiler property > character encoding > UTF-8
    &
    Select Tools--> Preferences--> environment
    and then set the UTF-8 encoding.

    no need to change your Trinity - config.Xml

    Concerning
    PY

  • My problem with the Java Applets

    Hi all

    I have a problem with these java applets. When I go to this link and want to see the java applet running from this site, as I face n ° 1 error below I press OK, and then I get the error no. 2.
    I disabled my AV (KIS 2013) and the Windows Firewall, but I still don't see the applet.
    Is it possible to fix this problem please?

    n ° 1:

    n ° 2:

    a brief search for shows "application blocked by security settings" that you might need to change the security level in the java console.

  • Problem with the Java PATH and HOME.

    Hey, so I tried to run a Java program through the console but I got an error that says:

    ERROR: JAVA_HOME is not set and no "java" command could not be found in your PATH.

    Please set the JAVA_HOME variable in your environment to match the installation location of java.

    So I edited the variable path: C:\Program Files\Java\jdk1.8.0\bin\java.exe and the JAVA_HOME variable to: C:\Program Files\Java\jdk1.8.0\bin\java.exe and I also tried to use jre8 instead of jdk1.8, but the program still did not run. Already, I went on the java Web site and the site Internet said the same thing about what to do so I ask here see if someone knows how to do this. I already know how to change system variables, but I'm doing something wrong with the path and the JAVA_HOME or y at - it a bug or something?

    Hello

    Check with the support of the Java program and the Support of Java - e-mailer or enter
    a message on their site if possible. Possible the program makes a wrong call.

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • recommendation of the Java web application development kit for small application

    Hi all

    I have an application developed using developer 6i, forms, and reports, as well as the Oracle 10 g for a school database. The application consists of student information, collection of fees and sms sending to parents.

    There are a lot of problems, with this app, DB is very heavy I'm using Oracle DB 10 g, installtion of 6i developer on the latest version of windows is another puzzle etc.

    Now, I want to pass to the application of the latest technology, but want this are light weight.

    Can I develop an application of light weight with ADF web application?

    Also, I want to use mysql as database.

    Thank you

    (1) you can use mySQL. I prefer Oracle XE, as it is better suited for the ADF.

    (2) application No. needs a weg server web. You can use weblogic or glassfish

    (3) just a browser

    Timo

  • Problems with the Java Extensions and new SDK 1.5

    Hello

    I had built a Java Extension with version 1.0 update modifing WidgetConfigImpl.java as PDF attached. And I was running properly.

    Now, with the 1.5 SDK don't work and Java not return a warning or an error.

    I have tried otherwise, generating a .jar and include it in the file ext with eclipse, but do not show the .jar in Add dialog, this same problem occurred at 1.0 and I solved adding that the Java plug-in with the attached PDF file.

    Y at - it new path by adding the extension modifing WidgetConfigImpl.java or something similar?

    Why anti-pop immediately following pushScreen in your code?  I don't even know what that would do, but there is a good chance that it will never show your screen.

    This does not work for the screen display?  Generally speaking, you would record your screen as a listener for an event and close the form this way, right?

    UiApplication.getUiApplication().invokeLater(new Runnable() {    public void run() {        try {            UiApplication.getUiApplication().pushScreen(_screen);        } catch (MediaException e) {             Dialog.alert("Error: " + e.getMessage());        }    }});
    
  • Problem with the installation of application using the OTA of the Tomcat server

    Hello

    I want to install my server application Tomcat suppose that here is the link to the example

    http://121.00.00.00:8080 / Web JSP project/Myapp.jad

    as he tried the link above in the Blackberry browser I get java.io.IOException as myapp - 1.cod not found...

    I placed the .jar, .jad, .cod in the folder web in the netbeans IDE and deployed in normal Office Internet explore if I click on the file link at the above address .jad opens for download where as Blackberry browser, I get an exception...

    can someone tell me how can I get it in the browser blackberry also...

    Kind regards

    Kiran

    You must only place a .jad and .cod on the server.

    However if .cod exceeds 64 k, it becomes an archive, you'll need to extract all the separate .cod files and place them in the same folder as the original .cod

    For example, you have MyApp.cod. Decompress and extract MyApp - 1.cod, MyApp - 2.cod

  • How can I report a problem with the Firefox Web browser?

    I use the Firefox web browser, my OS is Windows 10 pro. I am the webmaster for the site http://eckankarinoklahoma.org. When I revise and update the pages of the site, Firefox does not recognize changes you make until I hit the button reload (renewal) to the right of the address. However, when there is no button to reload a page, Firefox won't recognize the changes that have been made until I delete my browsing history. It seems to read pages web history. I tried everything to reload the page to get out of the site and back, etc.. to get Firefox to recognize the changes but it will not. As I said, the only way I can get it to recognize the changes is to delete my history, which is a real pain. The page is not a reload button is a password protected page. See the above site and click on the left menu "Connect members here." However, by visiting this page, you'll be able to see the problem until what you have visited and there again once it has been revised. The only revision made to this page is the date in the label asking the password. The password works fine, it's just that the label will never update and it is important for users to know in what section to find the password. Sorry for the verbosity of the present, but I hope you get the idea of the problem.

    When I look at this home page in the cache, I see that he arrived at expiration (date/time expiration in the past) and so Firefox should look for changes on the next load. If you check your cache, the pages of problem also expire? You can paste the following text in the address bar and press ENTER to load the cache for the homepage information:

    on:-l' the cache entry? storage = disc & uri = http://eckankarinoklahoma. org /.

    To display everything in the cache, start on the topic: cache page.

  • Problem with the transfer of applications to a new iphone

    My old 5s, new iPhone is 6 s. I got old and the other from backup restore. More than half of the applications do not appear on the new phone, nor do they appear in "not on this iPhone" appearing in the App Store. When I search a certain app I bought with my old phone, I suggested to BUY this new, even though I am connected with the same Apple ID. Is it possible to fix it?

    You can re - download previously purchased items in you log in to the App Store with the Apple ID used to make the purchase, then accessing the purchases tab.

    Due to the technology called App thinning, apps that have been uploaded to iPhone 5s are different from those needed for the iPhone 6 s, so they need to be downloaded again. This should be given automatically, unless you interrupted the process in some way, or does not give it enough time.

  • Problem with the download Web site

    I'm having a problem when I publish my site Builder at host gator.  The following errors are happening, and I don't know if these are problems of vista or not

    l\Temp\WER70C1.tmp.version.txt
    \Temp\WERC789.tmp.AppCompat.txt
    l\Temp\WERC7F7.tmp.mdmp
    Thanks advance!

    Cat hubrich,
    You will need to check with the Support of Ewisoft with this question.  Mike - Engineer Support Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I have a problem with the Java Console is disabled in Mozilla Firefox.

    Original title: Microsoft asked Firefox to disable the Java Console. Why?

    Next to the Java Console in the folder extensions on Firefox, there is a note that says that Microsoft asked us to disable this extension and more information. When I click on details it is a microsoft page but no information. It also covers other extensions that are disabled. No way to know what is the problem? I have Windows 7

    Thank you

    Any problem in FF, see their help or Forums

    You have a reason to use any Console Java plug-in?

  • Problem with the creation and application of models

    For somrthing that seems so simple, I'm having a problem to create and apply a template to a page only.

    First, I created a template as follows:

    1. display a full page (index.html)

    2 choose an editable region by highting the content area of the page. This excluded the header, the menu high horozontal, right bar and footer.

    3. went to 'INSERT'-> model-> editable objects

    4 name of container box editable and click on OK

    5. FILE - > save all

    The purple line was shown around the editable and the tag is displayed in the upper left corner of the combo box.

    I assumed that the combo box has successfully been created.

    Then, I tried to apply the model to a new page by using the following steps:

    1 has opened a new blank page called about.html

    2. went to: EDIT-> model-> apply the page model

    3. selection of the Model dialog box displays and I chose the region to editible (1 illustrated)

    select-template-box.jpg

    4. After selecting the editable area, this displsays error:

    inconsistent-region-names.jpg

    Error message reads as follows:

    Some Uea this document have no corresponding regions in the new document

    I tried several times, but I know I have to do something by mistake.

    Can someone help me in learning this task properly. Models seem to be such a powerful thing to use in development with DW.

    Thank you in advance.

    boblan1042

    Try this method:

    * FILE | New > template Page > select model > Create.

    A step by step method that works every time.  Once you familiarize yourself with the help of models, come back and I'll tell you why you receive the path you showed above.

  • Problem with the Lenovo A536 applications update.

    Hello, recently applications can not stretch. Can not update of applications like Facebook, Twitter, etc. I'm sorry for the bad English, use translate.google.com. Thanks in advance for your time.

    The problem is resolved. This is discussed in detail https://www.androidpit.com/forum/590684/google-play-store-how-to-fix-play-store-error-403

  • Problems with the initial web page et al.

    Hello

    I just downloaded Foglight and created a virtual machine from the file .ova.

    Logging on to the server Foglight has worked since the console - I need to manually change the IP address.

    I ping the Foglight Server from a computer on a different subnet.

    Following the instructions I can connect with a web browser.

    This fails as if the server is not active.

    Port 80 seems to be open, but tomcat is running.  Netstat - ano says tomcat has no open ports.

    On a likely related note, when I try to use putty (ssh) to the VM guest, I am challenged for a password, and

    Enter by default of the doc to install, but it does not work with access denied.

    When I use ssh from a Linux box on the subnet, it records the machine, then abandon the connection.  The following connections for this host fail with a "man in the middle" warning.

    Ideas?

    Thank you-

    Rob

    Hi Rob,

    When you have changed the IP address, you use the /usr/local/vkernel/scripts/changeIp.sh script?  If you tried to manually set using other methods, Tomcat configuration files will not be updated, and if the web server will not respond.

    The login/password for SSH usage is vkernel/vkernel.  Some people type it as 'vkernal' but it's 'vkernel.  Does not root via SSH.  You will need to "known" to the root once you have logged in as vkernel.

  • problem with the dell launch ' application Adobe first CC 2015.1

    Firma problema:

    Problem event name: APPCRASH

    Nome application: Adobe first Pro.exe

    Application version: 9.1.0.174

    Application timestamp: 564dce25

    Nome modulo con if: DNxHR.dll

    Versione modulo con if: 2.1.0.9

    Timestamp modulo con if: 55352343

    Codice exception: c000001d

    Offset exception: 000000000000f4c9

    SO version: 6.1.7601.2.1.0.768.3

    Locali impostazioni ID: 1040

    Additional information 1: b14f

    Further information 2: b14f0bb255ff1fda75b2218f14e23e1b

    Further information 3: 1a8d

    More information 4: 1a8d695bd80513a1d5d2f39f3606178d

    Leggere informativa sulla privacy online:

    http://go.microsoft.com/fwlink/?linkid=104288 & clcid = 0 x 0410

    SE informativa sulla privacy online no e disponibile, quella leggere offline:

    C:\Windows\system32\it-IT\erofflps.txt

    Hi stephanie,.

    For a fix, update for first Pro CC 2015 (9.2).

    Thank you

    Kevin

Maybe you are looking for