DateFormat from regional setting

Hi,
I have requirement to display the date in the format what is selected in the system's regional setting.
I am able pick the format with the help of code written below
((SimpleDateFormat)DateFormat.getInstance(DateFormat.Short, Locale.getDefault)).toPattern();
This is returning me the format in case of US ----> "MM/dd/yy"(Displaying 12/17/07), but systems regional setting shrt date displaying in the format ---> "MM/dd/yyyy".(Displaying 12/17/2007)
Can anyone give me the idea how I can get the same format.
Thanks in advance ,
Rohit

jcswing wrote:
Hi,
I have requirement to display the date in the format what is selected in the system's regional setting.Then you are going to have to write some Windows-specific JNI code to get that information from the registry. It's possible you might find that code on the Internet somewhere, but it isn't part of the standard Java API.

Similar Messages

  • Currency in report taken from regional setting and not infocube

    Dear All,
    I am facing very strange issue. I am using BEx analyzer 7.0
    I executed a report in Windows 2000, Excel 2003. The values are displayed correctly with currency which is in cube irrespective of the currency set in regional option in control panel.
    We are doing testing on windows vista and excel 2007 as we will upgrade to SAP GUI 7.10 and windows vista. I executed the report and the result values are matching but the currency is differant. The currency is taken from the regional settings in control panel. If I go to regional setting and change the currency, the report which is open in BEx analyzer changes the currency.
    We are facing this strange issue for only queries on 1 infocube. Other queries on another infocubes/multicubes are working fine.
    Has anyone faced the same issue. Please provide some pointers/solutions for above issue.
    Regards,
    Niraj

    Hi Shalu
    The Library 0FL has 4 currencies... i.e.
    HSL  - Local Currency  
    TSL   - Transaction Curre
    KSL  - Second Currency 
    OSL  - Third Currency  
    Go to GRR2 (Report form of your report), and double click on any column... You choose Key Figures in the Columns in a areport painter report... there you would have chosen any one of these currencies...
    Right click on the column and Copy it and paste it... Now change the Key Figure of the copied column to the one you desire...
    This should give you values in both currency...
    To identify which form you have used in GRR2 - Execute your report and go to Extras Menu > Technical Information.. In the pop up window that opens, double click on field "Report".
    Regards
    Ajay M

  • Font in Oracle Form open from Chinese & English Regional Setting

    Hi,
    we have oracle form deploy in oracle 10g as that will be open from PC that use Chinese Regional Setting and also PC that use English Regional Setting. The label however is in english.
    The problem is, the display & Allignment of the Font in English & Chinese regional setting will totally different.for the font already look nice on English PC, when we open from Chinese PC all the font & Allignment will be become not proper.
    If during development we allign and tested for Chinese PC, when we open from English PC, will have the same issue.
    is there any one have solution for this ?? cause this really frustating for us since our form is used by different country with different Regional Setting on their PC.
    Wondering how this problem solved in Oracle Application ?? or actually they have the same issue as well...
    Message was edited by:
    advisoft

    any one can give me a helping hand. plx

  • Error during running crystal report when the region setting to Vietnamese

    I have a report called stock movement which stockmovement.rpt file. It has some formula field where the formula is
    onlastrecord;
    numbervar SysClosingQty;
    IF {usp_Rpt_Crystal_StockMovement;1.ReferenceNumber}="" OR IsNull({usp_Rpt_Crystal_StockMovement;1.ReferenceNumber}) THEN
    {usp_Rpt_Crystal_StockMovement;1.SystemOpeningBalanceQty}
    ELSE
    SysClosingQty:={usp_Rpt_Crystal_StockMovement;1.SystemBalanceQty};
    After deploy to client side which have the region setting to Vietnamese culture, the execution of  this report throwing the following and the balance client machine working fine.:
    The remaining text does not appear to be part of the formula.
    Details:errorKind
    Error in File StockMovement
    .rpt
    Error in formula SystemClosingQty;
    'onlastrecord;
    The remaining text does not appear to be part of the formula
    Details :errorKind
    If we change back to English culture, it is working perfectly.
    How to resolve this issue.
    Kindly help and me and thanks for the kind help
    Malini

    See if the content of [this|http://msdn.microsoft.com/en-us/library/ms227600(VS.80).aspx] will help.
    The other option is to install CR 2008 designer on that computer - temporarily as a test only. Run the report in the designer and see if it works. Sometimes the designer will give you different error or better clues as to what is going on. E.g.; this could even be a database issue. An eval of CR 2008 is available from [here|http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx]
    - Ludek
    Edited by: Ludek Uher on Oct 7, 2011 7:23 AM

  • How to do Regional Setting Configuration in RDP session ( Eg Date Format, Currency, Decimal Seperator etc)

    Hi All,
    I am new to Windows Server 2008 R2 administration.
    I would like to know is there a way to  do Regional Setting Configuration in RDP session. i.e Date Format, Currency, Decimal Separator etc are based on users local machine.
    Eg If a user from UK logs in he should see date format as DD/MM/YY and if user from US logs in he should date format as MM/DD/YY.
    We are currently using citrix and we are managing this using logon script that runs based on citrix published application name.
    Is there any way we can achieve the same in RDP ?
    Thanks in Advance.
    Thanks & Regards,
    Nithin Kumar

    Hi Nithin,
    Do you need any other assistance?
    Thanks.
    Dharmesh Solanki
    TechNet Community Support

  • Applet doesn't work if regional setting is not US.

    Hi
    Mine applet works file if the regional setting is English (US). But If the regional setting is changed to French or japnese it gives problem due to diffrent time Zone.
    ex. 20-MAY-2004 as per US setting is interpreted as 21-MAY-2004 in French regional setting
    Below is the methods which give value as "20-MAY-2004" in US regional setting ( set from control panel to English US) but give value as 21-MAY-2004 if regional setting is changed to French.
    public String FindCtWeekEndingDate() {
    String sWkEndingDate = null;
    String sWkEnding =
    "Select TO_CHAR(trunc(sysdate, 'DY'), 'DD-MON-RRRR') from dual";
    PreparedStatement PSWkEnding;
    ResultSet RSWkEnding;
    try {
    PSWkEnding = conn.prepareStatement(sWkEnding);
    sWkEndingDate = "";
    RSWkEnding = PSWkEnding.executeQuery();
    if(RSWkEnding.next()) {
    sWkEnding = RSWkEnding.getString(1).toUpperCase(Locale.US);
    System.out.println(" Before Closing...###### " +RSWkEnding.getString(1).toUpperCase(Locale.US));
    PSWkEnding.close();
    System.out.println(" Before Returing .......#####"+sWkEnding);
    return sWkEnding;
    else {
    PSWkEnding.close();
    return null;
    catch (Exception e) {
    return null;
    } /* End if FindCtWeekEndingDate */
    Locale.US doesn't helpout in this case and giving same results.
    Any idea what need to donne...
    Thanks,
    Ashu

    Hi,
    I am not sure why you have to use SQL to get week end date
    You can do it with much ease using Java Calendar class
    Here is sample code of getting the weekend date ....
    // get the current date
    Calendar calendar = Calendar.getInstance();
    // set the week starting
    calendar.setFirstDayOfWeek(Calendar.SUNDAY);
    // set the day of the week as week end and get the date
    calendar.set(Calendar.DAY_OF_WEEK,Calendar.SATURDAY);
    // you can also get the month / year
    System.out.println(" weekend day is " + calendar.get(Calendar.DATE));
    If you decide to create a date-time formatter with a specific format pattern for a specific locale, you can do so with:
    new SimpleDateFormat(aPattern, new DateFormatSymbols(aLocale)).

  • Region setting is fixed to "Spain - Spanish" after PC Migration

    MBP has been in use for a couple of years with 1 user account (set as English). Have just migrated another user from a Spanish PC (Windows 7) which was running with Spanish region setting with English as its language.
    Used the Migration Assistant and all is well other than the Region is locked out in System Preferences. I can change it to anything I want but it reverts to "Spain - Spanish" regardless of any changes I make. I have added other languages and so on so the system (menus etc.) is okay but some basic preferences (e.g. dates, currency) will not change even in "Custom" setting.
    When you scroll through the Europe drop down for Regions there is a small dash next to Spain.
    Any advice on this strange one?
    Many thanks in advance

    Open the DVD Player, choose Get Disc Info from the File menu, and click on Regions.
    (32630)

  • Satellite L310-D4011: How to reset the DVD Region setting to 0?

    Dear All,
    I have a Satellite L310 D4011 machine which I recently purchased in which I installed a DVD player software.
    I run WinXP. A friend of mine played a music video from UK (Mccartney Live in Red Square) in the DVD player and the original region setting which was at 0 with 5 changes remaining, has gone to 4 changes remaining and the region is now set at 2. I am in India where the region for DVD is 5. If I change to 5, I lose another change option.
    I do not want to let my DVD ROM get stuck at 0 options left and in some other region.
    Can anyone give me an advice to reset the region back to Zero with five options remaining - the way it was when I bought the laptop?
    I shall be extremely grateful. Will the vendor from whom I purchased the laptop be able to set it back to factory setting?
    Best wishes

    Hello
    In my opinion Toshiba has nothing to do with it. To protect movie industry and their interests all notebook manufacturers offer optical disc drives where you can watch movies with different country code but 5 times only. The last chosen region code will be set as default. So if you have 4 more codes there is no reason for panic. Just continue to watch movies from your favourite region area.
    I am 100% sure that Toshiba service or vendor where you purchased your notebook will say that they have nothing to do with it. In drive properties you have clear statement how it works.
    Anyway you can try to contact them and ask for help.

  • DVD/CD Region setting problem

    I have a HP notebook with a Toshiba MK 8025GAS master DVD/CD drive with the slave TSST Corp CD/DVD TS-L532M I am having trouble changing the region settings as it states I have 1 change left but when I try to change the setting from Region 1 to Region 4, I get the responce "Unable to update region setting. Make sure the drive contains a region 4 media and you have administrative privilege". Can anyone please advise me what I can do about this? Thank you.

    Hi,
    The first thing to try is to choose a different Region 4 DVD and see if this works, sometimes you have to try several before finding one that works when resetting the Region Code of the CD/DVD Rom.
    Best wishes,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Channel strip colors from regions?

    Hi,
    I colored all my regions.
    Can I get the channel strip colors from regions?
    OR - as I've read on the internet - the only way for regions to and channel strip to be the same colors - one has to color the channel strips first?
    Thanks in advance...

    You can't because Logic would get really confused if you had a channel with more than one color on your regions.
    In the future, you could ctrl-click the track head in the sequencer and select 'Configure Track header' then tick track color bars. That will allow you to set channel strip colors and see them by the sequencer too. It's a great help if you want to identify tracks by color.

  • FaceTime missing from iphone5 setting

    Please note that I have both iPhone 4 and iPhone 5. Using them in Lebanon, Beirut. I noticed that the FaceTime on iPhone 5 has disappeared from under setting. I called my service provider and they said they have no restriction on FaceTime. They suggested that there might be some programming problem, but I checked with another person having the iPhone 5 and found the same problem.
    I tried so many fixes but all failed as it is not showing under settings.

    Read this document: http://support.apple.com/kb/HT1937?viewlocale=en_US&locale=en_US
    Particularly this footnote for "Middle East":
    FaceTime may be unavailable if your device originates from this region and becomes unlocked or is used in another country.
    If you purchased the phone in a Middle East country where it is not banned, it may be removed if you attempt to use it with a SIM from a different country. This is done to pacify the governments in the Middle East and prevent the feature from being used in a country where it is banned by law.
    Since the iPhone is not legitimately available at all in Lebanon, there is nothing much you can do.

  • Regional Setting

    Hi
    After changing the "Regional Setting" and refreshing the BW query, BW is working different depending on the Computer Regional Setting.

    A boolean variable will have the value true or false. That value only becomes a string when there is a conversion from boolean to string. For example, the following VBScript code converts a boolean to a string:
    Dim bVBBoolDim strVBBoolbVBBool = truestrVBBool = CStr(bVBBool)
    or this Javsscript code which converts a boolean to a string:
    var bBool = new Boolean(1);var strBool = bBool.toString();
    In VBScript, the assumption is that you are converting the boolean to a string for the purpose of displaying the value to an end user. So it attempts to "display" the value in the most suitable way for the end user. In the localized French IE, VBScript will convert the booleanvalue true to the string"vrai".
    If you call a VBScript function passing a boolean value on the same page, then the boolean will never be converted to a string and there will be no problem. When you try to pass a boolean value back to the server through a form parameter, that value must be converted to a string since that is the only way to send the value over Http. The best solution is to realize that there could be conversion error and pass an integer instead of a boolean. You might also have a similar problem if you were passing a datetime value. A datetime value internally is just a number. But if you try to pass it as a form parameter, then it will be converted to a string (and formatted according to some locale). The best bet is to proactively format in a locale neutral fashion so that the server will always know how to interpret the datetime regardless of the version of IE or the locale of the user.

  • Problem in Retrive values from result set

    I have a class where i do all database operation .First i fire select query and take values from result set and based on that value i fire update query.
    Problem is that i am not getting all values from result set . i get only last value and when i fire update query i get error as :Resultset is closed.
    I am using acess and java.

    You probably are using the same Statement object for both queries? Try creating separate Statement objects for each query. (My guess is this a problem with the way you're using JDBC, not a Servlet issue.)

  • How to retrieve date from a set type in SAP CRM in BRF+ application

    Hi,
    Can anybody please let me know how can I retrieve date from a set type in SAP CRM to BRF+.
    I need to process the data in BRF+ and then send it back to CRM. Thanks.
    Regards
    Yogesh

    Hi Manish,
    From my experience, you cannot change an existing attribute of a set type (esp. when it has a dependency).
    You need to delete the attribute, save the changes and then re-create the attribute with new value table.
    Also remove any dependencies before deleting the attribute.
    Regards,
    Vartika

  • How to change content type from Document set to Item

    While creating content type I've selected Item as a parent but after created I can see its showing Document Set as a parent content type. Now can anyone please suggest if possible I can change the parent content type from Document Set to Item.

    Hi,
    From your description, I know you want to change content type’s parent after creating it.
    There is no OOB method to change content type’s parent after you create it. If current content type has not been used, you could delete it and recreate it with your desired base type. Here are similar cases:
    http://sharepoint.stackexchange.com/questions/16131/change-base-content-type-of-content-type
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/b976f17e-99b5-42bb-bc82-8d4123a625cf/change-the-parent-of-a-content-type.
    This article may help you understand the relationship of Content type inheritance:
    https://support.office.com/en-au/article/Create-and-edit-content-types-3d5d45af-608d-4183-8d51-073095fe0312#__toc239159103.
    Best Regards
    Vincent Han
    TechNet Community Support

Maybe you are looking for