Java time and windows Regional Option

I want to return a time,so ,how is set on window's regional option.
I set time on windows Regional Option so - 13:38:29, bat java return another format 1:38:29.
for example. time is 13:40 PM on windows.
Calendar date=Calendar.getInstance();
date.get(Calendar.HOUR); this returns 1 not 13.
What to do to return 13 not 1.

Google (or even just the search box on this forum) is your friend:
http://forum.java.sun.com/thread.jspa?forumID=16&threadID=318720
http://forum.java.sun.com/thread.jspa?forumID=16&threadID=244377
http://forum.java.sun.com/thread.jspa?forumID=16&threadID=544738
http://forum.java.sun.com/thread.jspa?threadID=626159&messageID=9468678

Similar Messages

  • I would like to install my xerox 8560 multiple times and choose different options

    I would like to install my xerox 8560 multiple times and choose different options (simplex, multiplex, etc.) for each printer, so that I can just choose the printer with the options needed instead of choosing them every time.   Can that be done?

    Have a look at this link - hopefully it sorts it out for you...
    http://support.apple.com/kb/HT1428
    http://www.cultofmac.com/126621/how-to-move-or-rename-your-mac-home-folder-macrx /

  • Windows "Regional Options" locale - JCE for 8bit vs 16bit character sets

    I have a Java application that reads in an Encrypted text file. The text file was Encrypted using JCE 1.2.1 and Encrypted on a Windows system with the locale set to English(US). The Encryption uses Sun's version of the DES encryption algorithm.
    This app reads in the Encrypted text file and Decrypts it and processes it's information.
    This works fine on Windows systems if the Regional Options control panel is set to a region that uses 8bit character sets:
    - English
    - Italian
    - Spanish
    - French
    But, if the locale is set to 16bit character set regions, the text file cannot be read and parsed. Such regions include:
    - Russian
    - Greek
    - English (Hong Kong)
    At this point, I think I have two options, but I would love to hear about more:
    - Edit the Encrypting/Decrypting code (or the parsing code - parses through a comma deliminated file) so that the file that is Encrypted and Decrypted can handle either an 8bit or 16bit character sets
    (Don't know how to do this)
    or
    - Programatically change the locale of Windows machines to English(US) at application start-up and then change it back to the previous locale setting on application shut-down
    (Don't know how to do this either)
    I'd appreciate any help. I'm not sure if this is an International issue or an JCE issue.
    Thanks in advance

    I found an answer to the problem I was having.
    The culprit were two special characters that the client was using in the encrypted text to distinguish between different fields and to distinguish carriage returns (� and �). The non Latin alphabet languages didn't know what to do with those characters so they substituted there own characters, thus breaking the parsing logic which was hard coded to look for � and �.
    The problem also was related to the fact that the JCE works with byte[] arrays. FileInputStreams (which deal with byte[] arrays) seem to convert the special characters to new characters in non Lating languages to match what was going on in the JCE logic.
    The easiest fix I could come up with, was to include a new properties file to be read by a separate FileInputStream. This properties text file contained just two characters (��). When I loaded in this new properties file via a FileInputStream, the two characters (��) in the properties file magically change to match the currently active alphabet (or didn't change at all if the computer was using a Latin alphabet).
    By checking the new properties file to see what the characters had changed to (if they had), I was able to know what to use to parse the encrypted data. And as such, regardless of what language the computer was set to, the encrypted data is now parsed correctly, as I took out the hard coding that looked specifically for the characters � and � and instead rewrote the code so it now uses the characters from the properties file (or whatever characters they change to) for parsing the content data.
    I hope others find this useful.

  • Windows "Regional Options" locale (8bit vs 16bit character sets)

    I have a Java application that reads in an Encrypted text file. The text file was Encrypted using JCE 1.2.1 and Encrypted on a Windows system with the locale set to English(US). The Encryption uses Sun's version of the DES encryption algorithm.
    This app reads in the Encrypted text file and Decrypts it and processes it's information.
    This works fine on Windows systems if the Regional Options control panel is set to a region that uses 8bit character sets:
    - English
    - Italian
    - Spanish
    - French
    But, if the locale is set to 16bit character set regions, the text file cannot be read and parsed. Such regions include:
    - Russian
    - Greek
    - English (Hong Kong)
    At this point, I think I have two options, but I would love to hear about more:
    - Edit the Encrypting/Decrypting code (or the parsing code - parses through a comma deliminated file) so that the file that is Encrypted and Decrypted can handle either an 8bit or 16bit character sets
    (Don't know how to do this)
    or
    - Programatically change the locale of Windows machines to English(US) at application start-up and then change it back to the previous locale setting on application shut-down
    (Don't know how to do this either)
    I'd appreciate any help. I'm not sure if this is an International issue or an JCE issue.
    Thanks in advance

    I found an answer to the problem I was having.
    The culprit were two special characters that the client was using in the encrypted text to distinguish between different fields and to distinguish carriage returns (� and �). The non Latin alphabet languages didn't know what to do with those characters so they substituted there own characters, thus breaking the parsing logic which was hard coded to look for � and �.
    The problem also was related to the fact that the JCE works with byte[] arrays. FileInputStreams (which deal with byte[] arrays) seem to convert the special characters to new characters in non Lating languages to match what was going on in the JCE logic.
    The easiest fix I could come up with, was to include a new properties file to be read by a separate FileInputStream. This properties text file contained just two characters (��). When I loaded in this new properties file via a FileInputStream, the two characters (��) in the properties file magically change to match the currently active alphabet (or didn't change at all if the computer was using a Latin alphabet).
    By checking the new properties file to see what the characters had changed to (if they had), I was able to know what to use to parse the encrypted data. And as such, regardless of what language the computer was set to, the encrypted data is now parsed correctly, as I took out the hard coding that looked specifically for the characters � and � and instead rewrote the code so it now uses the characters from the properties file (or whatever characters they change to) for parsing the content data.
    I hope others find this useful.

  • Wrong image refresh in java applet AND Windows 7

    I'm managing since few days a java applet that takes an image from an industrial product and shows it in a browser (simple web server).
    There is following issue: the image is not correctly loaded and refreshed in its own window if just opened but only if the applet is running on Windows 7. The issue is solved as soon as I reduce the window to icon (minimize) and then resize it. I'm looking into java documentation on how to manage the image rendering, maybe I have to override some update or redraw method more, but it is taking time and I'm still learning. NOTE that the window opened does show the issue only when the windows size is not completely shown in the monitor.
    Meanwhile I'm wandering if some of you faced and solved similar problem.
    Thank you in advance,
    Elena

    Thank you Nitin for your quick reply!
    These are the calling of the functions in the code. As you can see, before to show the image, we are managing a zoom/unzoom by mouse wheel and an addition of writings data on the image itself. All is working fine except on W7:
    public void paint(Graphics g)
         //System.out.println("[ImageFrame::paint my paint!!!]");
         this.PaintImage(g);
    public void update(Graphics g)
         // System.out.println("[ImageFrame::update]");
         this.repaint();
    public void PaintImage(ImageInfo imageInfo, float fps)
         if (imageInfo != null)
              if (this.getImageInfoRef() == null){
                   this.setVisible(true);
              this.setTitle("Image Viewer (" + imageInfo.bufferedImage.getWidth() + "x" + imageInfo.bufferedImage.getHeight() + ") ");
              this.resizeImageFrame((int) (imageInfo.bufferedImage.getWidth() * zoomFactor), (int) (imageInfo.bufferedImage.getHeight() * zoomFactor));
              this.lastFps = fps;
              this.setImageInfoRef(imageInfo);
              //System.out.println("this.getWidth(): " + this.getWidth() + " this.getHeight(): " + this.getHeight() + " zoomFactor: " + zoomFactor);////
              this.PaintImage(this.getGraphics());
    public synchronized void PaintImage(Graphics g)
         ImageInfo locImageInfo = getImageInfoRef();
         if (locImageInfo != null)
              try
                   this.resizeImageFrame((int) (locImageInfo.bufferedImage.getWidth() * zoomFactor), (int) (locImageInfo.bufferedImage.getHeight() * zoomFactor));
                   BufferedImage bufferedImage = this.resizeBufferedImage(locImageInfo.bufferedImage, zoomFactor);
                   this.overlayCodeInfo(bufferedImage, locImageInfo.decInfoStruct, zoomFactor);
                   this.overlayPointerInfo(bufferedImage, locImageInfo.scaling, zoomFactor, this.crossX, this.crossY);
                   this.overlayFrameRateInfo(bufferedImage, this.lastFps);
                   Image img = Toolkit.getDefaultToolkit().createImage(bufferedImage.getSource());
                   boolean retdraw;
                   retdraw = g.drawImage(img, frameUpperBondarySizeX, frameUpperBondarySizeY, this);
              catch (Exception ex)
                   System.out.println("[ImageFrame::PaintImage] Exception: " + ex);
    Thank you again
    Elena

  • Java Swing and WIndows User Localles

    HI,
    We need to develop a java applet/application which can be switchable at run time to accept and display characters in multilanaguages. This java applet will run on a windows 2000 server with multilanguage pack installed. Is it possible to dynamically switch languages at run time. The machines default localle and operating system installation is US English.
    We have tried some tests with traditional chinese and UI components in Swing but with no success in displaying or inputing valid chinese characters. Has anyone attempted a simliar thing and have any insights that may help.
    Thanks in Advance,
    Jono

    Yes. It's called JList. Have a look at the tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/index.html

  • DIAdem Connectivi​ty Library and Windows Regional Settings

    Hi,
    I'm having a bit of a problem with a CVI program that uses the DIAdem connectivity library when deployed to PCs that have their "Language for non-Unicode programs" set to some non-English language (Japanese is one, but I suspect this will happen with others).  The problem comes up with file properties in TDM files that use the µ or 'mu' symbol in their Property name.  When I call the DDC_GetFilePropertyNames(...) function, I get different strings from the same .tdm file depending on whether I have Windows set to English (US) or Japanese.  As far as functions like DDC_GetFileProperty(...) are concerned the Property name string I get when my Windows is set to English is correct and I get an error using the string from when Windows is set to Japanese (-6213 DDC_PropertyDoesNotExist).  The end result is that my program functions just fine so long as the PC is set to English, and fails on PCs where it is set to Japanese.
    I've attached a small sample console program.  It will ask whether or not you want to create a .tdm file when run.  If yes, the program will create a test.tdm file with a property named "Test_With_µ_Symbol".  In either case, it will attempt to read the file, calling  DDC_GetFilePropertyNames(..) to read the property names, then DDC_GetFilePropertyType(...) and DDC_GetFileProperty(..) using the property name it gets back.  In order to see the problem I'm having, compile and run the program on a PC set to English.  It will have no problems reading the file property back.  Then take the file program to PC set to Japanese and run it, telling it to not create a new file (i.e. just read the existing file), and when the program attempts to read back the file property back it will fail.  Curiously enough if the program is compiled on the Japanese system it will have no problems running, which suggests that CVI will compile a different program depending on your Windows language setting (!?).
    As configuring a computer to use Japanese may be a bit of a pain, here are the bytes in the strings I get back from  DDC_GetFilePropertyNames (...) on the English system (top) and the Japanese system (bottom) which is really the heart of the problem I'm having.  The difference is the -75 on the top string and the -125 and -54 on the bottom string, corresponding to the 'mu' character:
    84 101 115 116 95 87 105 116 104 95 -75 95 83 121 109 98 111 108
    84 101 115 116 95 87 105 116 104 95 -125 -54 95 83 121 109 98 111 108  
    (I didn't post the actual strings as the forum may end up mangling the characters) 
    Thoughts?  I guessing I might be doing something I shouldn't by trying to use the 'mu' character in property strings, but on the other hand I don't think that DDC_GetFilePropertyNames (...)  should be giving different results based upon Windows language.  Thanks in advance for any help.  I'm running Windows XP and CVI 2010SP1.
    Attachments:
    DDCTest.zip ‏3 KB

    Hi tstanely,
    Another possible solution is to try and perform the solution that was mentioned in the Unicode forum in LabVIEW. At the end of the forum, Mark Moss mentions "One of our interns recently went through this adapting a program to display Chinese in the user interface.  His solution ended up being surprisingly simple:  Just read the strings from a text file stored using the target encoding.  In our case, there were really only two encodings of interest: Windows code-page 1252 (used on our company's computers located in North America) and UTF-8 (used on our company's computers in China)."
    Because it seems that the CVI is encoding strings in the application based on the code page used at the time, it might be possible to have multiple text files saved in the different code pages and to load the strings at run-time. You may still have to use the Multibyte Character Set functionality to determine the platform that is being used, etc.
    Milan

  • Java, Cygwin, and Windows.... oh my.

    So the problem can be summarized as follows. I have a call out to the operating system from Java to obtain the value of “vmstat” which returns a value from every “x” seconds based on the refresh rate. To do This I use a command similar to this
    Runtime rt = Runtime.getRuntime();
    String[] comm = new String[] {"vmstat","1"};
    Process proc = rt.exec(comm);
    I can then loop around capturing the output and parsing it. Simple.... This approach works on Linux, Mac OS, HP-UX, AIX and Solaris however it fails under Windows. It sits there and simply waits. Now this appears to be a common problem based on the number of postings on it. This article(http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html) suggests a number of approaches to solve the problem. I’ve tried them all and the good news is that they appear to work for a single atomic call that returns all of its output then exits. However commands such as “vmstat/iostat/sar” etc. return output periodically based on their refresh rates and don’t seem to work at all.
    There are plenty of hits in google but no one really seems to suggest a solution. Now Im sure this worked in the past and Im almost certain that I haven’t changed the code.
    I’ve tried calling
    java myexec cmd /c "c:\\cygwin\\bin\\ls.exe"
    Which returns the first line of the directory and then exits.
    java myexec cmd /c "c:\\cygwin\\bin\\ls.exe"
    simply hangs.... whilst
    java myexec cmd /c dir
    Works fine.... So my believe its the combination of java and cygwin and the way io is redirected. If anyone has a chance to look at it.... I’ll be very grateful. Code for simple testcase below.
    import java.util.*;
    import java.io.*;
    class StreamGobbler extends Thread {
    InputStream is;
    String type;
    StreamGobbler(InputStream is, String type) {
    this.is = is;
    this.type = type;
    public void run() {
    try {
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    while (true) {
    if (is.available() == 0) {
    try {
    Thread.sleep(10);
    } catch (InterruptedException ie) {
    continue;
    line = br.readLine();
    if (line == null) {
    System.out.println("Error");
    } else {
    System.out.println(line);
    } catch (IOException ioe) {
    ioe.printStackTrace();
    public class myexec {
    public static void main(String[] args) {
    try {
    String osName = System.getProperty("os.name");
    System.out.println(osName);
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(args);
    // any error message?
    StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR");
    // any output?
    StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT");
    // kick them off
    errorGobbler.start();
    outputGobbler.start();
    // any error???
    int exitVal = proc.waitFor();
    System.out.println("ExitValue: " + exitVal);
    } catch (Throwable t) {
    t.printStackTrace();
    Edited by: dgiles on Apr 3, 2009 6:27 AM

    Apologies for the code tags.... now included below
    +"I’ve tried calling+
    +java myexec cmd /c "c:\\cygwin\\bin\\ls.exe"+
    +Which returns the first line of the directory and then exits.+
    +java myexec cmd /c "c:\\cygwin\\bin\\ls.exe"+
    +simply hangs"+
    should read
    "I’ve tried calling
    java myexec cmd /c "c:\\cygwin\\bin\\ls.exe"
    Which returns the first line of the directory and then exits.
    *java myexec cmd /c "c:\\cygwin\\bin\\vmstat.exe*"
    simply hangs"
    I agree with the comments about the quality of the example.... it was a quick and dirty hack. It dosen't take away from the issue that it works on every combination except windows and cygwin....
    Any other thoughts?
    import java.util.*;
    import java.io.*;
    class StreamGobbler extends Thread {
      InputStream is;
      String type;
      StreamGobbler(InputStream is, String type) {
        this.is = is;
        this.type = type;
      public void run() {
        try {
          InputStreamReader isr = new InputStreamReader(is);
          BufferedReader br = new BufferedReader(isr);
          String line = null;
          while (true) {
            if (is.available() == 0) {
              try {
                Thread.sleep(10);
              } catch (InterruptedException ie) {
              continue;
            line = br.readLine();
            if (line == null) {
              System.out.println("Error");
            } else {
              System.out.println(line);
        } catch (IOException ioe) {
          ioe.printStackTrace();
    public class myexec {
      public static void main(String[] args) {
        try {
          String osName = System.getProperty("os.name");
          System.out.println(osName);
          Runtime rt = Runtime.getRuntime();
          Process proc = rt.exec(args);
          // any error message?
          StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR");
          // any output?
          StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT");
          // kick them off
          errorGobbler.start();
          outputGobbler.start();
          // any error???
          int exitVal = proc.waitFor();
          System.out.println("ExitValue: " + exitVal);
        } catch (Throwable t) {
          t.printStackTrace();
    }

  • Please allow for text and window colour options

    Dear sweet lord, I understand that skype is free with premium options. It's wonderful for that, HOWEVER, I cannot read the names or timestamps easily in convos because I cannot adjust the pale, low contrast colours. I am 23 years old and am losing my eyesight. I'm not old by any means and I'm willing to accomodate the changes that inevitably happen with UI's, but I hate having to resort to changing my entire system scheme to something from Windows 98 just so I can read my darn convos with people.
    The system theme is awful and distracting, blocky, and badly designed, and it makes web browsing irritating. Being forced to use it on my whole system just to use Skype more easily, and having the accessibility panel with a single checkbox and no actual in program options to make the different elements easier for me to see is irritating. I'm not to the point yet where I need a black and white scheme or need it read to me, I do like the simplicity that was being aimed at, but in the quest for Aesthetics it missed the boat on accessibility. As of right now I have my font set on large and bold so I can see it better, but the lack of contrast between the colours really is an issue and could even be solved by having presets built into skype itself so I don't have to mess with my entire theme.

    I could work with that so long as it was limited to skype and not my entire system. The big issue here is while yes, it integrates with my computer's accessibility options, I cannot adjust anything in skype itself. It is literally a single checkbox that says "enable accessibility mode". I'm guessing it's their attempt at idiot proofing or something.
    I have to open control panel and switch to one of the annoying high contrast themes just to override a single application. Efficiency at it's finest  

  • Java Swing and windows listview control

    Hi,
    many programming languages have the listview control, to which you can define diferents kinds of data's organizers as Icon, Detail, List, etc.
    Somebody knows if java swing have a component as the listview ?
    thanks

    Yes. It's called JList. Have a look at the tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/index.html

  • Ipod nano and windows XP pro

    I just purchased a new Ipod nano. I installed iTunes 7 and am able to download and move songs. Itunes recognizes my ipod but everytime I dock or open iTunes I get a:
    Found new hardware wizard that pops up. It states
    " there was a problem installing this hardware.
    Apple iPod USB Device
    The specified service does not exist as an installed service"
    Some times it will pop up 4 or 5 times and the only option button that work is the "Finish" button. After 4 or 5 times it goes away until I close and re-open Itunes or undock and dock my Ipod.
    Any help is greatly appreciated
    Thanks!!

    If your iPod shows up in Explorer under 'my computer' try changing the drive letter:
    -- Click on Start=>Control Panel=>Admin Tools=>Computer Management=>Disk Management
    -- Right-Click on the iPod and select “change drive letter”
    -- Choose something further along in the alphabet that is unused (Usually, “M”, “N”, “O” or something similar)
    -- Safely eject the iPod
    -- Reboot the PC

  • Tabs and windows grayed out

    i cant save any tabs and windows the option is completely grayed out what do i do also i cant add trouble shooting info because i keep getting a error saying the addon could not be downloaded because of a connection error to support.mozilla.org

    ''animefan01 [[#question-1036856|said]]''
    <blockquote>
    i cant save any tabs and windows the option is completely grayed out what do i do also i cant add trouble shooting info because i keep getting a error saying the addon could not be downloaded because of a connection error to support.mozilla.org
    </blockquote>
    also just checked and the session restore file in program files is missing how do i get a new one

  • How can I get my clock to remain on the correct time when starting bootcamp and windows XP? wireless option is not available.

    How can I get my clock to remain on the correct time when starting bootcamp and windows XP? wireless option is not available.

    Have a look at solutions in here https://discussions.apple.com/message/10689317#10689317
    Regards
    Stefan

  • In Options -- General -- I want the option to "Show my windows and tabs from last time" AND "Show my homepage", but that choice isn't given. When I open a new tab, I'd like to see my iGoogle page, not a blank screen. Hope you can help. D

    In Options --> General --> I want the option to "Show my windows and tabs from last time" '''''AND''''' "Show my homepage", but that choice isn't given. When I open a new tab, I'd like to see my iGoogle page, not a blank screen. Hope you can help. D

    You can middle-click or Ctrl left-click the Home button on the Navigation toolbar to open the Home page in a new tab.
    You can look at one of these extensions:
    * NewTabURL : https://addons.mozilla.org/firefox/addon/newtaburl/
    * New Tab Homepage : https://addons.mozilla.org/firefox/addon/new-tab-homepage/

  • Run-Time Error window doesn't have Retry and Ignore options

    Hi,
    The run-Time Error window usually have 4 bullets at the bottom part.  They all used to be enabled untill recently.  Somehow, I only have the Run Cleanup and Abort immediately bullets enabled.  Why are the Retry and Ignore disabled?  Is there an option to turn it on and off?
    Thanks
    Rafi

    Hi,
    Its possible you have operator privileges. What's user type are you running as?
    Regards
    Ray Farmer
    Regards
    Ray Farmer

Maybe you are looking for