WD date format & Java standard locale-based pattern

Hi,
  I have a requairement to implement application that utilize WebDynpro and Servlet programming in one product. Application must be fully localizable. My only problem at the moment is to make WD date input field working exactly thesame as standard Java DateFormat class (or inversely to make Java DateFormat class work in exactly the same way as WD date input field). For example:
Locale: en_GB (set in browser properties and assigned to portal user)
WD date input field: 31/08/2006
Java DateFormat class: 31/08/06
Snipped of code that produces formated Java date:
DateFormat.getDateInstance(DateFormat.SHORT, locale).format(date);
The only problem with this locale is 2-digits year field instead of 4-digits, but in other locales there might be other problems.
I would be appreciate for any help.
Kind regards,
  Marcin Zduniak

Marcin,
Technically, the required format on servlet side is:
DateFormat format = new SimpleDateFormat("dd/MM/yyyy", locale);
System.out.println( format.format(new Date()) );
However, it's quite complex task to make generic mapping for every locale -- most probably you need internatioanlized property files (one per locale) with formatting strings.
Valery Silaev
EPAM Systems
http://www.NetWeaverTeam.com

Similar Messages

  • Strange date format in german locale

    According to /usr/share/i18n/locales/de_DE the date format for german locale is defined as follows "2000-06-24", which is not very common in German-speaking countries.Usually date is written as "24.06.2000". Some programs use this "wrong" format.
    Is it save to edit the file mentioned above to achieve this format?
    Last edited by tyr0 (2010-08-05 18:04:05)

    tyr0 wrote:Thank you, karol, formating the file didn´t force programs to use the new format. Maybe my editing isn´t correct.
    Actually it isn´t a real problem, because in scripts you can use "date +%d.%m.%g", so I´ll mark this topic as solved.
    I see that you decided against marking it as solved - or you forgot about it :-)
    Which programs are showing the wrong date? They may be using their own date format and your locales are / were fine.

  • How to modify date format for Standard Purchase Order

    In the Standard Purchase Order I have been trying to modify the date format of the Need by and Promised Date. To display DD-MON-YYYY please could some advise.
    Thanks

    The varaibles and prarameters I am using are.
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ora="http://www.oracle.com/XSL/Transform/java/" xmlns:xdofo="http://xmlns.oracle.com/oxp/fo/extensions" xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.apps.xdo.template.rtf.XSLTFunctions" xmlns:xdoxliff="urn:oasis:names:tc:xliff:document:1.1">
    <xsl:param name="_XDOCALENDAR">GREGORIAN</xsl:param>
    <xsl:param name="_XDOLOCALE">en-US</xsl:param>
    <xsl:param name="_XDOTIMEZONE">GMT</xsl:param>
    <xsl:param name="_XDODFOVERRIDE">;</xsl:param>
    <xsl:param name="_XDOCTX">#</xsl:param>
    <xsl:variable name="_XDOXSLTCTX" select="xdoxslt:set_xslt_locale($_XDOCTX, $_XDOLOCALE, $_XDOTIMEZONE, $_XDOCALENDAR, $_XDODFOVERRIDE)" />

  • How to modify date format for Standard Purchase Order  Template XSL-FO

    I am editing the XSL-FO for the Standard Purchase Order.
    I need to modify the promised date column to 'DD-MON-YYYY’' , tried to use substring in below line but it didn't work
    <xsl:value-of select="LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE"/>
    Any solution for this ?
    thanks
    Pravin

    Thanks for your response.
    I tried to change the code in below format but it was giving error.
    Original code
    <xsl:value-of select="LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE"/>
    modified to
    <xsl:value-of select="xdoxslt:format_date(LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE,'dd-mmm-yyyy','dd/mmm/yyyy hh24:mi:ss',$_XDOLOCALE,$_XDOTIMEZONE)"/>
    also tried with
    <xsl:value-of select="xdoxslt:format_date(LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE,'dd-mmm-yyyy','dd-mmm-yyyy hh24:mi:ss',$_XDOLOCALE,$_XDOTIMEZONE)"/>
    also tried like
    <xsl:value-of select="xdoxslt:format_date(LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE,'dd-mmm-yyyy','dd/mmm/yyyy',$_XDOLOCALE,$_XDOTIMEZONE)"/>
    Tried above 3 methods but it didn't work.
    right now the date format in pdf file is 24-MAY-2011 21:56:24 i need to remove 21:56:24 and have only 24-MAY-2011
    any suggestions.
    thanks

  • How do I change the date format to standard dd/mm/yy?

    I've looked through the settings, I've looked through the help files and I've searched the forums, but I couldn't even find mention of this. My phone will only display the date as mm/dd/yy, which as far as I know is only used in USA and I've set my location to London.
    Normally this isn't a problem unless the numbers are close eg. 11/10/13, which I would always read as 11th October 2013 and I have gotten this wrong before.
    The only solution I have is a label stuck on the phone to remind me.
    This is only a minor irritation, but as I can't fix it, I would appreciate any help.
    Thanks
    JP

    Unfortunately, I do not have a Firefox OS device, so this is based on an old screen shot I saw in a search...
    During initial setup, you may have been asked to confirm your language and region. I believe the region is used to localize your date format. Can you find a setup app to get back to those choices? Please be advised that running a setup app may remove some data, so it's probably a good idea to wait for additional feedback before actually going forward with it.

  • [solved] German date format, but english locale?

    Salut,
    I prefer the system displaying English texts, though I need German date and number formats. How can I change the date formats?
    Thanks in advance,
    Stefan
    Last edited by vbtricks (2008-05-11 09:50:41)

    I've solved it by doing such:
    $ cat /etc/profile.d/_locales.sh
    # Locale
    export LANG="en_US.utf8"
    export LC_NUMERIC="sv_SE.utf8"
    export LC_COLLATE="C"
    export LC_TIME="sv_SE.utf8"
    export LC_MONETARY="sv_SE.utf8"
    export LC_MEASUREMENT="sv_SE.utf8"
    export LC_CTYPE="sv_SE.utf8"
    export LC_MESSAGES="en_US.utf8"
    And then in my .bashrc I have the following:
    if [ -f /etc/profile ]; then
    . /etc/profile
    fi
    /etc/profile will go through all files in /etc/profile.d/ and source them if they are executable (so chmod a+x it).

  • Get date format given a locale

    Hello All
    if i have a Locale how can i extract date format attached to the Locale given?
    Is there any api support . i do not want to use simpleDAteFormatter or such classes....
    method should return date format eg "M/d/yyyy" for US local?
    can any one help
    thanks
    prash

    Primarily why do u not want to use the SimpleDateFormat class or related classes ? It would make formatting pretty easy, for e.g. i'm using the DateFormat class to give you a rouch indication of the formatting -
    Date dt = new Date();
    DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.US);
    String formattedDate = df.format(dt);
    System.out.println("Formatted date: " + formattedDate);

  • ISO date format to local date format

    All
    I have a requirement to convert the given ISO date format String to local date format String
    Can someone give the the piece of code to do this
    e.g I receive the following String "2003-03-15T09:00:00" and need to convert this to "03/15/2003 09:00:00"
    Thanks

    Check out java.text.SimpleDateFormat.

  • How to take System Date format

    Hai,
    DateFormat class has various date format like DEFAULT, SHORT, MEDIUM, LONG. These format will display the date in a particular format. As well as Using SimpleDateFormat class we can give our own format.
    I want to display the date with system date format. In our system we can set any date format using control panel. But how can we take that format from our program.
    If any one know give me idea..
    Thanks.

    The default locale should be enough to set the correct date format for you. You can check the currently set locale with java.util.Locale.getDefault(). java.text.DateFormat.getDateInstance() generates the proper date format for that locale.
    The other poster is right, though. You're asking for an OS dependant function which Java, rightly, does not do.

  • Date Format in Windows

    Is it possible to get the date format from windows locale setting?
    I'm using Java 1.6 and the date format instance for SHORT is not the same as windows locale setting.

    Ah, I see now, sorry.
    Must admit that I do not know the answer to this question. I always thought that Java assumed a 'standardised default' for each Locale and did not actually take any account of the platforms settings. Also, I do not think that the language exposes this information anywhere; I have not conducted an exhaustive search but cannot find anything in the System and Toolkit classes that would seem to give you access to this setting.
    It may be worthwhile searching to see where this setting is exposed throuhg the win32API. That way, you could always write native code to read the setting, access that using JNI and then make use of the setting. That would still leave one problem IMO; what would you do if the user changed the Windows date setting? Alternatively, you could use a ResourecBudnel to parameterise the date string. That would be far easier to implement and allow the user to establish their own (horror) defaults - assuming this is acceptable given the requirements of the application.

  • Date format when submitting concurrent program

    I am getting some odd behavior off of a new PC build when trying to submit a concurrent program. This occurs only on this PC. CPs using the PER_DATES_STANDARD value set will no longer accept the Oracle standard of '01-AUG-2011'. The following message displays:
    Please enter date value 01-AUG-2011 in correct format: MM/DD/RRRR
    I have looked at the 'Preferences' link in the Self Service area and also all of the 'DATE' profiles within Applications and I cannot find anything that would cause this. I even tried forcing a format for my user profile without success. Can anyone tell me where to change this format?
    We are using Apps version 11.5.10.2.

    scott_h wrote:
    Scott,
    Please see these docs.
    IE8 AND R12 SECURITY SETTING REQUIREMENT ON CROSS SITE SCRIPTING (XSS) [ID 1069497.1]
    Date Fields in Forms render like dd#mm#yyyy When Using Internet Explorer 8 [ID 1061707.1]
    Thanks,
    HusseinThanks to both of you for looking at this with me, here is what we found: the date format was dependent on how we logged into the Applications session. When logging in directly to the forms server bypassing the self-service page login, the date format within Applications was based on the OS format. When logging in through the self-service page, it was using the format specified in the Preferences link of the page. This is new behavior after our recent move to a secure https URL. Not sure why but we know the issue. I will look at those docs to see if they relate. Thanks again.This makes little sense - if this issue was linked to settings in Preferences, then the issue should be able to be replicated from any PC, not just a specific one.
    HTH
    Srini

  • Inconsistent date formats between Rich Client and HTML client

    Hey All,
    Just wondering if anyone has come across an issue with inconsistent date formats from a universe based on an MS SSAS 2012 database connection in 4.x?
    The value of the date is returned as a string from the query but the object data type has been changed to a Date object meaning BusinessObjects should convert the string into a date if the format is correct.
    The problem in this is that the date being returned in Rich Client is in dd/MM/yyyy format whereas on the Web Client is in MM/dd/yyyy.
    From the Web Client business objects will return a date, however, it is a mix of MDY and DMY format.
    i.e. 15th of March will be displayed as 15/03/2014
    whereas 12th of March will be displayed as 03/12/2014
    All our application servers are configured for English (Australian) regional settings meaning all dates should be in DMY format.
    The date in the database is stored as a non-ambiguous yyyy-mm-dd format so it appears the variation is occurring somewhere between the database and BusinessObjects for the Web Client based reports only.
    I have also checked the sqlsrv.prm file based format and changed this to DMY but this has also not made a difference.
    The same universe in 3.1 and MS SSAS 2008 works correctly but not this one.

    Hi
    The date in the database is stored as yyyy-mm-dd format.
    As per user request.... Set the date format @ the Business layer level. so it will refelct same as in the WebI.
    Please find the below link. how to use custom Display option.
    BI4.1 Business Layer Enhancements - Create Display Format

  • Date format conversion in PL/SQL

    Hi,
    am new to pl/sql can any one please tel me how to wright a function to convert date format.
    I have date in database with different formats, the data type of the date in database is 'VARCHAR'. I want to convert the date format to standard format say 'DD-MON-YYYY'.
    In database i have different formats of date like 'dd-mon-yyyy',dd/mm/yyyy,dd.mm.yyyy,dd.mm.yy,MON DD,YYYY etc with some other formats also..
    Please tel me how to wright a function in pl/sql to convert date in to standard format.
    Thanks in advance.

    Ooops, which idiot stored dates as strings? That was silly.
    You'll have to aim to recognise each format... e.g.
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select 1 as id, '01/02/2008' as dt from dual union all
      2             select 2, '14.07.2007' from dual union all
      3             select 3, 'APR-21-2007' from dual union all
      4             select 4, 'NONSENSE' from dual)
      5  -- END OF TEST DATA
      6  select id,
      7         CASE WHEN regexp_like(substr(dt,3,1), '[\.,\/]') THEN
      8              CASE WHEN length(dt) = 8 THEN
      9                TO_DATE(dt, 'DD/MM/YY')
    10              ELSE
    11                TO_DATE(dt, 'DD/MM/YYYY')
    12              END
    13              WHEN regexp_like(dt, '^([[:alpha:]]){3}-') THEN
    14                TO_DATE(dt, 'MON/DD/YYYY')
    15         ELSE
    16           NULL
    17         END as date_dt
    18* FROM t
    SQL> /
            ID DATE_DT
             1 01/02/2008 00:00:00
             2 14/07/2007 00:00:00
             3 21/04/2007 00:00:00
             4You're problem will come if you actually have dates stored as both DD/MM/YYYY and MM/DD/YYYY type formats because then you won't know if e.g.
    01/02/2007
    is
    1st Feb 2007 or 2nd Jan 2007

  • How to change Data Format

    I'm using Sql Developer vers. 1.1.2. for Oracle 8.1.7 and I can't change Data Format. Even if first I run "alter session set nls_date_format = 'DD/MM/YYYY';" and after I run "select data_field from table;" in the SQL Worksheet, it goes on reporting the field in format "MM/DD/YYYY HH:MI:SS". It seems to me as if the "alter session" doesn't work.
    I've got a problem with decimal separator too. I mean when I run "select salary_field from table;" and the item is for example 2300,32 the report gets null column even if I've set Decimal Separator to "," from Tools>NSL Parameters>Decimal Separator.
    I need help.
    Thanks in advance
    Marco

    Marco,
    It isn't really a great help, as you need to access 8.1.7, but the current version doesn't have this problem - it uses the current NLS_DATE_FORMAT setting to format the date, regardless of the NLS preferences.
    I have vague memories (1.1.2 has largely faded from my memory) that when they first introduced the NLS preferences that they took precedence over the DB NLS settings (ie date formatted in SQL Developer based on NLS preferences).
    On the decimal separator, I have other vague memories of problems if you didn't set both the Decimal and Group separator, although a quick search on the forum didn't highlight something that seemed the same as your problem. After logging on (ie with the NLS preferences as the DB NLS settings), what do you get if you the NLS_NUMERIC_CHARACTERS parameter in the NLS_SESSION_PARAMETERS view? This should have two characters - the first one being the decimal separator and the second being the group separator.
    theFurryOne

  • Date Format Customizing

    Hi All,
    Kindly let us know whether it is possible to change the date format for the locale specified for the portal user in UME.
    ex : for the locale en-us default date format is MM/dd/yyyy can it be customized to dd.MM.yyyy
    Thanks in adnvance,
    Regards,
    Chandran S

    Hi Chandran,
    Please check the below forum threads,
    Date Format dd/MM/yyyy?
    How to change the Date format
    Hope this helps.
    Thanks,
    Ansar

Maybe you are looking for

  • Mac Not Recognizing External Hard Drive, I Want to Use the HDD to boot Windows

    Let's get this stuff straight first: The Hard Drive is from a PC that I am not using The Hard Drive already has Windows 8.1 installed as well as all my documents and data. (from the old PC, of course.) It does work, however after connecting it to my

  • Issues in persisting dynamic entity and view objects using MDS

    Hi All, I'm trying to create dynamic entity and view objects per user session and to persist these objects throughout the session, I'm trying to use MDS configurations(either file or Database) in adf-config.xml. I'm facing following two errors while

  • Basic question .... How can I set up a page for visitors to enter data?

    Is it possible in iWeb 08 to set up a page that visitors enter data in specific fields and allow me to retrieve that information? Like filling out a form, then emailing the form to my .mac mail. Thanks.

  • Problem to auto-center VI

    Hi, I'm running a keypad program in Labview 5.0.  When I click the white arrow, the top bar and the scroll bars disappear to leave me only with the keypad.  This works perfectly, except that the keypad is not centered in the middle of the screen.  I

  • Trouble recording 25% fill in an action

    When recording an action, layer fill can be set as a numerical field, however the value is not recorded in the action despite the value actually being set. To duplicate: Open a documnet using Mac OS 10.7.3 start recording an action duplicate Backgrou