How To Convert GMT?

I am working on an application. Every time a user (User A) submits an article or a message, the Greenwich time of the submission is stored in the database no matter which the time zone the user (User A) is.
Another user (User B who may be in another time zone) may later on retrieve the article or the message submitted by User A.
I want to display the User B local time of the Greenwich time saved in the database. How do I convert the GMT?

Hi Natalie,
you need to use time zones. Here is an example that creates a Calendar and then displays it in different time zones. Take a look at the java.sql.ResultSet API and you'll see that you have a getDate method that allows a Calendar to be specified.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Calendar;
import java.util.TimeZone;
import java.text.DateFormat;
public class TimeZoneTest extends JFrame {
     private JTextField LocalTime = new JTextField(8);
     private JTextField GMT = new JTextField(8);
     private JTextField NewYorkTime = new JTextField(8);
     private JTextField TokyoTime = new JTextField(8);
     public static void main(String[] a){
          TimeZoneTest tzt = new TimeZoneTest();
     TimeZoneTest() {
          userInterface();
          // set times to now
          DateFormat showTime = DateFormat.getTimeInstance(DateFormat.MEDIUM);
          Calendar localCalendar = Calendar.getInstance();
          LocalTime.setText(showTime.format(localCalendar.getTime()));
          // do other time zones
          showTime.setTimeZone(TimeZone.getTimeZone("GMT"));
          GMT.setText(showTime.format(localCalendar.getTime()));
          showTime.setTimeZone(TimeZone.getTimeZone("America/New_York"));
          NewYorkTime.setText(showTime.format(localCalendar.getTime()));
          showTime.setTimeZone(TimeZone.getTimeZone("Asia/Tokyo"));
          TokyoTime.setText(showTime.format(localCalendar.getTime()));
     private void userInterface() {
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setTitle("TimeZoneTest");
          Container cp = getContentPane();
          JPanel p = new JPanel(new GridLayout(4, 2));
          p.add(new JLabel("Local time"));
          p.add(LocalTime);
          p.add(new JLabel("GMT time"));
          p.add(GMT);
          p.add(new JLabel("N.York time"));
          p.add(NewYorkTime);
          p.add(new JLabel("Tokyo time"));
          p.add(TokyoTime);
          getContentPane().add(p);
          pack();
          setVisible(true);
}Hope this helps.
sjl

Similar Messages

  • How to Convert  GMT in EST timezone

    We are comunicating with a system,which send date and time in this format - GMT Date and time in YYYYMMDDHHMISS where HH is 24 hour format.Our server has EST (US) time zone. Now I have to validate if the received time stamp from our client is with in +/- 5 minutes, we need to allow him to do some operation.So How can I compare the time stamps in GMT and EST.Which java classes I need to use to accomplish it, any code snippet wil be hepful
    thanks in advance
    pary

    Try this it may help you.
              Date date = new Date();
             DateFormat estFormat = new SimpleDateFormat();
             DateFormat gmtFormat = new SimpleDateFormat();
             TimeZone gmtTime = TimeZone.getTimeZone("GMT");
             TimeZone estTime = TimeZone.getTimeZone("EST");
             estFormat.setTimeZone(gmtTime);
             gmtFormat.setTimeZone(estTime);
             System.out.println("GMT Time: " + estFormat.format(date));
             System.out.println("EST Time: " + gmtFormat.format(date));Result::
    GMT Time: 10/5/05 5:37 AM
    EST Time: 10/5/05 1:37 AM

  • How to convert GMT time into IST on weblogic server

    Hello,
    i am using Weblogic server interconnected with webcenter content, in my application i am uploading document, the uploaded time it is showing is in GMT , and on oracle webcenter content i am getting uploaded time in Indian Standard Time that is "+05:30" so in my application what i can do to change time from GMT to Indian Standard Time
    Regards
    Mayur Mitkari

    Hi Mayur,
    As I mentioned earlier also change the system time then your weblogic will start taking IST time zone.
    Regards,
    Kal

  • How to convert class file

    Hi all, I am new in java card development.
    This is my environment setting:
    @echo off
    set JC_HOME=C:\JavaCard\java_card_kit-2_2
    set JAVA_HOME=C:\j2sdk14103
    set PATH=.;%JC_HOME%\bin;%PATH%
    I have created the Wallet applet according to 'Zhiqun Chen" text book and named it WalletApp.java.
    I have compiled this file to a class file.
    This is where is I saved my file
    C:\JavaCard\java_card_kit-2_2\samples\src\com\sun\javacard\samples\WalletApp\WalletApp.java.
    But I don't really understand how to convert the class file.
    May I know what is this for?
    -out EXP JCA CAP
    -exportpath
    -applet 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1:0x1
    com.sun.javacard.samples.HelloWorld.HelloWorld
    com.sun.javacard.samples.HelloWorld
    0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1 1.0
    must save this in what file?
    I tried to type in the command line below (and the result):
    C:\JavaCard\java_card_kit-2_2\samples>converter -config scr\com\sun\javacard\sap
    les\Wallet\Wallet.opt
    error: file scr\com\sun\javacard\saples\Wallet\Wallet.opt could not be found
    Usage: converter <options> package_name package_aid major_version.minor_ver
    sion
    OR
    converter -config <filename>
    use file for all options and parameters to converter
    Where options include:
    -classdir <the root directory of the class hierarchy>
    set the root directory where the Converter
    will look for classes
    -i support the 32-bit integer type
    -exportpath <list of directories>
    list the root directories where the Converter
    will look for export files
    -exportmap use the token mapping from the pre-defined export
    file of the package being converted. The converter
    will look for the export file in the exportpath
    -applet <AID class_name>
    set the applet AID and the class that defines the
    install method for the applet
    -d <the root directory for output>
    -out [CAP] [EXP] [JCA]
    tell the Converter to output the CAP file,
    and/or the JCA file, and/or the export file
    -V, -version print the Converter version string
    -v, -verbose enable verbose output
    -help print out this message
    -nowarn instruct the Converter to not report warning messages
    -mask indicate this package is for mask, so restrictions on
    native methods are relaxed
    -debug enable generation of debugging information
    -nobanner suppress all standard output messages
    -noverify turn off verification. Verification is default
    *********************************************************May I know What is the correct command line to convert the class file and what must I do to before converting the class file?
    I saw some article saying we must use JDK1.3, is it a must?
    Your solution is highly appreciated.
    Thank you!

    Hi Ricardo,
    I saved the file below as WalletApp.opt in the directory of scr\com\sun\javacard\samples\WalletApp
    -out EXP JCA CAP
    -exportpath c:\javacard\java_card_kit-2_2\api_export_files
    -applet 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x2:0x1 WalletApp.WalletApp
    WalletApp 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x2 1.0
    But I still have the problem below:
    C:\JavaCard\java_card_kit-2_2\samples>converter -config scr\com\sun\javacard\sam
    ples\WalletApp\WalletApp.opt
    error: file scr\com\sun\javacard\samples\WalletApp\WalletApp.opt could not be fo
    und
    Usage: converter <options> package_name package_aid major_version.minor_ver
    sion
    OR
    converter -config <filename>
    May I know What's wrong with my command or file?
    Where can I download JDK because what I can find is J2SDK.
    Thank you!

  • How to convert string to 16 characters.

    My external unique id is too long, more then 30 characters.
    How to convert it to 30 characters using sql?

    You should find another extranal system id in order to mantain uniqueness, but you could also use the name field (that supports 50 characters), but it deppends of which entity you are using.
    Which is the entity? and...if the only way to insert data is by web services the you could use more than one field to verify uniqueness since you can query more than one field at the time.
    Hope it helps
    Kim.

  • How to convert Web app into a channel?

    To whom it may concern,
    Does anyone know how to convert a Web app into a channel inside the Portal server 6.0?
    I developed the web app and tried to create a provider and a channel for it, but the Portal server did not recognize the WEB-INF folder and give me errors saying that it couldn't locate the class files.
    I also have a problem with URL inside my jsp page (channel).
    For example, I have two jsp pages:
    /etc/opt/SUNWps/desktop/default/MyCustomProvider/test1.jsp
    /etc/opt/SUNWps/desktop/default/MyCustomProvider/test2.jsp
    and when I try to put a link from test1.jsp to test2.jsp using
    ... and make a channel based on test1.jsp. The channel will display the link as "http://mydomain/portal/test2.jsp" and result in "Error: page not found". I want the link to point to
    /etc/opt/SUNWps/desktop/default/MyCustomProvider/test2.jsp
    To summarize my questions,
    1) Where should the web app be located in the Portal server?
    2) How to make a link inside one jsp page (channel) to point to another page inside the same folder?
    Thank you in advance

    Hello Karthik,
    I just tried to solve my problem with your suggestions, unfortunately, my JSP channel still doesn't work :(
    The portal server keeps reporting "Server Error..." when I tried to add query at the end of the href.
    Do you still have any other suggestions?
    Thank you

  • Video Format Total Solution: How to Convert and Edit Video on Windows/Mac

    More and More video formats are coming out with different video encoders and it makes our spare time more and more colorful. However, it is not to say that there is no problems. Actually, different video formats make it difficult to share video with others, even your own camcorder and iPod. Is there an easy way to convert videos effectively. Yes, there is.
    In this article, I will show you guys how to convert videos on windows and mac.
    Part 1. How to Convert and Edit Videos on Windows
    For Windows users, you need a Video Converter(http://www.aiseesoft.com/total-video-converter.html) to do that for you.
    Here I use Aiseesoft Total Video Converter(http://www.aiseesoft.com/total-video-converter.html)
    Step 1: Download and install Aiseesoft Total Video Converter
    After you download it to your computer, double click it and it is really easy to install.
    You just need to click “next” and it will complete it in seconds. It will automatically run after installation.
    http://www.aiseesoft.com/images/guide/total-video-converter/screen.jpg
    Step 2: Load Video
    Click “Add File” to find the video that you want to convert and click “open”. It will be loaded automatically.
    Step 3: Select the target to decode
    In the “Profile” drop download list you can find your target according the usage of your output video, such as if you want to put the video on your iPod touch, you can select the “iPod” in the first list and “iPod touch 2 MPEG-4 640*480(*.mp4)” in the second list.
    Step 4: Set Advanced Parameters
    After you select the right output profile, you can click “setting” button to set your advanced parameters. You can adjust video and audio settings separately. In video section, you can change “video encoder”, “resolution”, “frame rate”, “video bitrate”In audio section, you can change “audio encoder”, “sample rate”, “channel”, “audio bitrate”If you want to save this profile and settings and use it next time you can click “save as” button to give a name to it. And the next time you want to use it you can find it in the profile list named “user defined”.
    Step 5: Choose a Destination
    To browse and find a output folder for your output files or just the default one.
    Finally, Click “Convert” button to begin your conversion, here in the converting
    interface you can choose “shut down the computer when conversion complete” or “open output folder when conversion complete” or you just do not choose neither one.
    Tips: How to Edit the Output Video
    This video converter is also a video editor, you can use it to edit your output video as follows:
    http://www.aiseesoft.com/images/guide/total-video-converter/effect.jpg
    1. Effect:
    You are allowed to adjust the “Brightness”, “Contrast”, “Saturation” and you can choose the “deinterlacing” to make the video more enjoyable.
    2. Trim:
    In “Trim” section you can pick up any part of the video to convert.
    There are two ways to select the part of the video you want. One is set the start and end time in the box. The other one is to drag the start and end button in the processing bar.
    3. Crop:
    This function allows you to choose a certain play area to convert. That means you can choose a part of the screen you like to convert. For example, you just like the tv in the middle of the screen, then you can drag the frame around the preview window to select the tv and the output preview will show you the output video.In this section you can also choose the “zoom mode”, such as “keep original”, “full screen”, “16:9”, “4:3”.
    4. Watermark
    In the section, you can add a watermark on the output video to show people something, such as your name, website, studio name or other things. The watermark could be words and picture. You can adjust the transparent of the watermark easily to make it more beautiful.
    Part 2. How to Convert Video on Mac
    This time you need a Video Converter for Mac(http://www.aiseesoft.com/video-converter-for-mac.html)
    Step 1: Add File
    Click “Add File” button to load the video you want to converter
    http://www.aiseesoft.com/images/guide/mac-video-converter/steps.jpg
    Step 2: Choose profile and adjust settings
    You can find your output video format from a drop-list called “Profile”You can also adjust the specific settings of the output video, such as “Resolution”, “Bitrate”, “Encoder” and so on.

    @ Tamwini
    Your only goal is to sell software.
    ‡Thank you for hitting the Blue/Green Star button‡
    N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009

  • How to convert data from a report in PDF which are specified on multiple lines ?

    It often occurs that in a report one detail entry is folded onto two subsequent lines.
    e.g.
      No.  
    Container          Lt Ht Tp F/E     Dam          Weight Temp     Bi Im First Seal     No. Cell     Booking ref.
    In Arr    id     A         Tml         PoL PD   PoD             C T L R F B                                                                                 
    1       XXXU123456-7  20 ST I F                        24.000                                  SLX11            1    25A     CVA12345  
    How does the conversion to Excel is going to handle this ?
    I need the second line of data in my excel sheet.
    YES               9/10   14:15        BEANR   REFCT

    Hello Jay,
    Don't use SSIS to convert. Use SSIS to FTP the files out.
    How you convert to PDF: the format is owned by Adobe so there might be royalties involved, but there are paid and free (OSS) libraries to doing so. Just search online.
    Arthur
    MyBlog
    Twitter

  • Very Urgent--- How to Convert Non Valuated stk into Valuated

    Dear GURU'S
    Actually for a material A when i see the stock in MM03 in accounting tab i see less stock then when i see in MMBE
    i.e in MMBE if i select Material A and Plant B(Which is depo in my case) i see stock as 39
    but for same material MAterial A and Plant B ,if i see in MM03 --in accounting tab i m able to see less stock i.e only 1
    ============================================
    Well the problem is In MM03 I cud see only valuated stk i.e qty as 1
    And in MMBE for a partiocular material for a particular plant the stock was 39
    i.e Here i am getting Valuated + Non valuated stock
    i.e i am getting difference of 25
    =====>>>
    To get into the root cause
    I have gone to MB5B where i can get all the transaction that has been done on this material with movement type also i got the intial stock ,Goods recpt ,Goods  issu and total stock
    No for a particular material
    In MB5B it is showing
    Stock on 01.01.2005    =  38
    receipts total               = 238
    Issues total                  =237
    Stock as on 18.02.2008 = 39(which is equal to Stock in MMBE)
    =============>This is for valuated +Non valuated stock
    Where as if i want to see only valuated stock it was showing
    receipts total      = 238
    Issues total         =237
    Stock as on 18.02.2008 =1  (which is equal to stock in acctg view in MM03)
    ====================>This is only for Valuated Stock
    ======================================
    Now how to solve this :
    The initial qty(38) which has been posted it was at the begining that is at the start of the project
    And the people who have posted it ,it was non valuated
    that is the reason it is showing difference in MM03 and MMBE
    First thing
    How can i see on which date this initial stock has been posted
    Second Query
    How to convert this non valuated stock into Valuated stock
    So that the quantity in MMBE and MM03 gets matched
    Willl award 10 Points if my problem gets solved
    THANKZ IN ADVANCE
    REgds
    Shailesh

    Dear friend
    Actuallly i have checked the history of that particular Item in MB51
    I have gone through all the documents created for this material
    Now this material also exist in DEPO which is located at chennai and plant is at mumbai
    So Initially in the year-2006(31-10-2006) whater documents are created i.e STOP has  been created and delivery has been made (Mov type-601)
    are non valuated stock ,means they have been posted without any valuation
    But from year 2007(01.02.2007) the documents whiohc have been posted are valuated
    i.e is the reason when i am executing transaction MRN9 to check the history of valuated stock
    I cant see non valuated stock
    Well now how to do the valuation of this stock which have been posted in year 2006 so that
    In MMBE and MM03 there is no difference of stock
    Plz hepl
    regds
    shailesh

  • How to convert a .jad file to .class file in JAVA Swings.

    Hi all,
    Sorry for the interruption.I am also facing the same problem.I am using DEJDecompiler.But my application is not J2ME But J2EE.( a Swing application).I opened .class file and made some changes but I dont know how to convert into a .class file again.
    I tried saving .jad file to .java file.Then it is showing lot of errors in Eclipse Platform.I doubt if there are any errors in the .class file already,then how could the program would run.I put all the programs in the respective platforms only and then testing.It fails.
    (2) one more question,is if I do not need to disturb any existing coding and need to create a seperate java file which will do my customisation,then what should I do.I could not get any interfaces in the program.
    Please help me as the matter is most urgent.
    Thanks in advance
    With regds
    Satheesh.K

    I tried saving .jad file to .java file.Then it is
    showing lot of errors in Eclipse Platform.I doubt if
    there are any errors in the .class file already,then
    how could the program would run.I put all the programs
    in the respective platforms only and then testing.It
    fails.So who's Java program/library are you trying to steal?
    (2) one more question,is if I do not need to disturb
    any existing coding and need to create a seperate java
    file which will do my customisation,then what should I
    do.I could not get any interfaces in the program.
    Please help me as the matter is most urgent.Wow, you urgently need to steal someones program/library. The best person to give you advice urgently is the owner of the program/library you are trying to steal.
    Thanks in advancePlease don't thank me because I'm not going to help you!
    With regds
    Satheesh.K

  • How to convert the javasource file(*.class) to execute file(*.exe)?

    How to convert the javasource file(*.class) to execute file(*.exe)?
    thank you!

    Although i have seen a few programs (that are platform specific) that will embed a small jvm into an exe with your class file, it is generally excepted that you cannot create an executable file using java. The JAR executable file is probably the closest your going to get
    Pete

  • How to convert java class file version without decompiling

    Hi,
    Oracle R12.1.3 i am having illegal access error while try to access the class file version Java 1.3 uses major version 47,So how to convert the class file version without using decompiling.
    Current java version is 1.6.0_07
    Is there any tool or API for converting class file version?
    Thanks,
    Selvapandian T

    Beside this I wonder where you get your error from since AFAIK 12c comes with java 1.6.
    Well wonder no more!
    OP isn't using Oracle 12c database.
    They are using Oracle R12.1.3 - which is the E- Business Suite.

  • How to convert a class file to exe file and how to cteate a class file to d

    how to convert a class file to exe file

    Hi Bhaskarq,
    Hi,
    It is not at all possible.
    But it is a really worst method.
    Please go through it.
    This is a very common question asked in the comp.lang.java newsgroup. Its often useful to have an
    executable application when deploying your
    applications to a specific platform, but remember to
    make your .class files available for users running
    Unix/Macintosh/other platforms.
    Microsoft provide a free system development kit (SDK),
    for Java, which includes the jexegen tool. This
    will convert class files into a .EXE form. The only
    disadvantage is that users need a Microsoft Java
    Virtual Machine (JVM) installed. If your target
    platform is Win32, you can either redistribute the
    virtual
    machine, or raise the level of your system
    requirements, to include Windows 98, or Windows 95
    with
    Internet Explorer 4. Systems matching these
    requirements will already have a copy of the Microsoft
    Java Virtual Machine installed.
    Note : You must specify all of the class files your
    application needs (except for standard java packges)
    as a parameter, so if you have third party libraries,
    you'll need to include them as well. You can use wildcards * though, and you don't need the original source code.
    Also please see this Forum which will give a good idea
    http://forum.java.sun.com/thread.jsp?forum=31&thread=149733
    I hope this will help you.
    Thanks
    Bakrudeen
    Technical Support Engineer
    Sun MicroSystems Inc, India

  • How to convert .class into .jar file

    Hi,
    How to convert .class into .jar file

    jsf_VWP5.5.1 wrote:
    Hi,
    How to convert .class into .jar fileFrom a command prompt, cd to the location of your .class file(s).
    If you want to create a simple jar, use: jar -cf Whatever.jar Whatever.class
    If you want to compile all .class files in a directory into a jar, use *.class instead.
    Now, I'm going to assume you want to create an executable jar... here's how to do that:
    1) Create a blank text file; for this example, lets call it main.txt.
    2) In the first line of main.txt, type: Main-class: Whatever ('Whatever' should be the name of the class in your program where the main() method is located)
    3) Press enter to go to the next line (someone please correct me if I'm wrong, but if you don't insert the line break/CR after the Main-class: statement, this will not work... in my experience, this is true)
    4) Make sure you save this file in the same directory as your .class file(s).
    5) Type: jar -cmf Whatever.jar main.txt Whatever.class
    ...and that's about it. For more information on the usage of the jar command and to understand the switches (such as -cmf), try jar --help.
    Hope that helps.

  • How to convert .class file to exec file...

    hi.
    how to convert .class file to exec file...
    please explain me clearly.....
    thanks...

    Placing your exact "question" into google:
    http://www.google.com/search?q=how+to+convert+.class+file+to+exec+file...

Maybe you are looking for

  • MS Office changed Open With

    The file  "Open With" option for pdf files was changed  by MS Office to open all files with Outlook  (it was an operator error - mine ) but my problem is that I can't change it back.  The image on the icon shows office and not the standard pdf file i

  • Oracle.jbo.uicli.binding.JUIteratorBinding cannot be cast to oracle.adf.

    HI , I'm using ADF 11g, I'm working on individual work space. i have used oracle.adf.model.binding.DCControlBinding in my bean class and working fine .Now one day before i have taken svn version repository project and started working .I made simple j

  • How can I download Acrobat Pro?  Not listed in CC App Manager.

    I have a CC membership.  When I click on "Download" Acrobat Pro, it open the CC Application Manager, but Acrobat (as well as some other apps) isn't listed as possible apps to download.  How do I get it? Running:  Windows Vista, dual core 2.0 Ghz Inte

  • SRM, BBP_SC_TRANSFER_GROUPED Auto grouping by Plant

    Hi, We have a requirement to add Plant as a grouping criteria in program BBP_SC_TRANSFER_GROUPED to combine requisition in SRM system. The standard logic only does the grouping based on Vendor and Purchasing group. Do you know any solution to the abo

  • Moving the iTunes Folder

    Hi All: iTunes stores its XML library in the following folder on my C:\ Drive: \Documents And Settings\Administrator\My Documents\My Music I have copied the iTunes folder and all its XML library documents to my E: drive. Does anyone know how to get i