MM/dd/yyyy OR dd/MM/yyyy DateFormat ????

i have a string that will be in either of the above formats - anyone know how i can tell which one its in before parsing it ??
muchos gracias
schtevie

Where are you receiving the data from? If this is coming from a browser you can pick-up the locale from the httpservletrequest headers and if it is coming from an ordinary java client then the jre will have a default locale set. Once you have the locale then you can construct a DateFormat object and call parse(String s) to build a date. This relies on them using the ISO-spec'd formats but then again, why wouldn't they? ;-> If you've just got the data from an unknown source you've no chance of being certain but there are far more locales that use dd/mm than mm/dd, (sorry yanks).

Similar Messages

  • Convert Date (MM/DD/YYYY) to (Month DD, YYYY)

    Hi,
    I am looking for a Function Module that converts MM/DD/YYYY to Month DD, YYYY format. For example, 07/27/2009 is to be converted to July 27, 2009. Is there any standard FM that works for this purpose? Please advice.
    Appreciate Your Help.
    Thanks,
    Kannan.

    Read this.
    https://wiki.sdn.sap.com/wiki/display/Snippets/FUNCTIONMODULEFORCONVERTINGDATEINTOTHEGIVENFORMAT
    Arti

  • How to convert Date in varchar(50) format MM/DD/YYYY HH:MM into YYYY-MM-DD format using MS SQLServer 2008 R2 ?

    Hi,
    I am getting the error "The conversion of a varchar data type to a datetime data type resulted in an out-of-range value."
    when converting date in format Date in varchar(50) format MM/DD/YYYY HH:MM into YYYY-MM-DD format using MS SQLServer 2008 R2.
    Please note that the date in column is Date(varchar(50), null).
    I used the following syntax:
    SELECT  CONVERT(VARCHAR(10), Date, 102) AS Day
    FROM   dbo.[RCap_2G MM/Operator]
    WHERE  (CONVERT(VARCHAR(10), Date, 102) > { fn NOW() } - 1)

    As noted above, either use ISDATE or TRY_CONVERT with the correct conversion style number:
    -- SQL Server 2012 code
    DECLARE @Date varchar(50) = '10/23/2006 10:20';
    SELECT TRY_CONVERT(DATE, @Date, 101) AS Day
    -- 2006-10-23
    Datetime conversion blog:
    http://www.sqlusa.com/bestpractices/datetimeconversion/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How to change data format from  MM/DD/YYYY to DD/MM/YYYY

    HI,
    How can we change data format from MM/DD/YYYY to DD/MM/YYYY in Prompt and Report Level in obiee 11g.
    Please help me ont this.
    Thanks

    Hi,
    In Prompt:
    Try using EVALUATE function.
    Eg: Evaluate('TO_CHAR(%1,%2)' as character(30),"D5.Times"."Day Date",'DD-MON-YYYY')
    Report level:
    Try this in the column formula-
    Evaluate('TO_CHAR(%1,%2)' as character(30),"D5.Times"."Day Date",'MM/DD/YYYY')
    (or)
    EVALUATE('TO_CHAR(%1,%2)' AS CHARACTER ( 30 ), "Dim- Date".Start Date, 'MON-YY')
    http://108obiee.blogspot.in/2009/03/how-to-change-date-format-mask-in-date.html
    http://obiee-bip.blogspot.in/2011/08/customizing-obiee-calendar-display.html
    Some other methods.
    Metdhod 1:
    'Save System-Wide Column Formats' Option
    Check this.
    http://siebel-essentials.blogspot.com/2010/10/11-obiee-11g-tips-9-system-wide.html?m=1
    Thanks
    satya

  • I want the organiser in Elements 13 to create folders with the format yyyy mm dd, not yyyy dd mm. How do I do that

    Photoshop elements 13 organiser
    I want to import the photos into folders by shot name in the following format: yyyy mm dd, NOT yyyy dd mm. This used to be possible.. I have nearly 100 folders organised already as yyyy mm dd (actually half are yyyy-mm-dd). How can I do this?
    Thanks in advance for your help
    Suzanne

    I noted the old bug and its reference to version 10 of the organiser, I think.
    I am running 64 bit Windows 7.
    I had set the date format in the preferences as dd/mm/yyyy as that is how we format it in Australia. That is when the preferences for the format of subfolder creation came up as yyyy dd mm.
    I then tried setting the date format in the preferences in the US format, that is, mm/dd/yyyy. This fixed the anomaly: the preferences for the format of subfolder creation came up as yyyy mm dd.
    I don't understand the logic and I think this was something that was missed in the update.
    So thanks for the suggestion but I think it is a little bug with a simple though slightly illogical workaround.
    Should I report it to Adobe?

  • Change date format in ms excel 2013 form MM-DD-YYYY to DD-MM-YYYY

    Dear sir
    I have got a database from my client where the entire dates are in MM-DD-YYYY format. However my system runs in DD-MM-YYYY format(based on my company lines).
    So i need to convert  this MM-DD-YYYY to DD-MM-YYYY format
    Please help
    Thank you

    If you want to change the format in excel ,Click 'Home' Tab in the Ribbon-> In 'number 'Group->Choose 'more number format'-> 'custom'->change the 'type' as "DD-MM-YYYY".
    Or use the formula =TEXT(A1,"DD-MM-YYYY")
    If you want to change the format when export it from SQL Server Database to excel.
    Use
    select Convert(VARCHAR(10),column name,105) as date from
    database name

  • Date Formats (dd/mm/yyyy and mm/dd/yyyy)

    Is there anyway to change the date format from mm/dd/yyyy to dd/mm/yyyy? I'm using XP and have changed all settings I can to UK from US but nothing changes. It's quite frustrating as I am used to the UK system.
    Thanks.

    georgemc wrote:
    kajbj wrote:
    Spoiler: Reply #3 is actually the answer to your question.Also, Bruce Willis is a ghost, the Titanic sinks and Verbal is Keyzer Soze.Only one of those endings really surprised me.
    You should've heard me in that theatre when the Titanic struck that iceberg...

  • How test the date formats  M/d/yyyy and MM/dd/yyyy .

    how test the date formats M/d/yyyy and MM/dd/yyyy .format should accept 3/3/1982 and 03/03/1982 dates.
    please help me

    georgemc wrote:
    kajbj wrote:
    Spoiler: Reply #3 is actually the answer to your question.Also, Bruce Willis is a ghost, the Titanic sinks and Verbal is Keyzer Soze.Only one of those endings really surprised me.
    You should've heard me in that theatre when the Titanic struck that iceberg...

  • Cal.Year/ Month - Applet - MM.YYYY and  HTML- MMM.YYYY

    Hi All.
    I have created Webi Report on top of Bex Query. 
    While running the webi report Cal.Year/ Month Prompts list of vales showing format as MM.YYYY (01.2014) in Applet version.
    and running the same report with HTML version, Cal.Year/ Month Prompts list of vales showing different format as MMM.YYYY (Jan.2014).
    I have checked at bex Q level Cal.Year/ Month variable have List of values MM.YYYY (01.2014) format.
    Cal.Year/ Month - @
    Bex Q : MM YYYY
    Applet - MM.YYYY  
    HTML- MMM.YYYY
    Need to understand same report Cal.Year/ Month Prompts list of vales showing  different format (Applet - MM.YYYY. HTML- MMM.YYYY).
    is there any way to fix the issue display same format in the both version.

    Hi Sateesh,
    Thanks for reply.
    Are you using Unv /BICS ?  BICS
    Did you checked both applet and HTML version with the same user ? Yes, Same user
    HTML and Applet version report pointed to same BO and BW system ? Yes, Both BO and BW systems are same. (development systems)
    In BEx , variable values shows both text and key and when value selected it only show key in the entry field box .- Yes, bex variable and characteristic defined display as KEY.
    I have created Cal.Year/ Month Prompts at webi level….while refresh the report. Cal.Year/ Month Prompts  list of vales showing  different format (Applet -MM.YYYY (01.2014). HTML- MMM.YYYY (Jan.2014)).

  • HTMLB Dateformat change MM/DD/YYYY to DD/MM/YYYY

    Dear Experts,
    My application(.par) is showing date in the format MM/DD/YYYY. How can i change the date formate to DD/MM/YYYY. I hered it is possible through Browser settings. But i unable to find that setting.
    Please find the code written in my application-
    <hbj:gridLayoutCell
                                                 rowIndex="1"
                                                 columnIndex="2">
                                                 <hbj:inputField
                                                      id="dateFrom"
                                                      type="DATE"
                                                      showHelp="TRUE"
                                                      size="10"
                                                      value="20060401"/>
    I need to set date 1st, Apr 2006 in the formate of 01-04-2010. But now it is displaying as 04-01-2010.
    Could you please any one help me to change the date formate.
    Regards,
    Vijay.

    Hi,
    Things you must consider on formatting dates:
    1. The first locale to be read is that marked on UME (language).
    2. If that on would be blank, then will be read from the browser language.
    3. If all those are blank, then, will be read from the locale of the JVM. But, you must be sure that change the locale of the JVM will affect all the formats of all applications that use it.
    Regards

  • How to change MM/DD/YYYY to DD/MM/YYYY

    hi i have a requirement.
      CONCATENATE SY-DATUM TEXT-T01 SY-UNAME INTO V_TEXT.
    here sy-datum is in the format of MM/DD/YYYY now i have to replace sy-datum with DD/MM/YYYY.
    Thanks,
    Maheedhar.T

    Give the input as 11/10/2006
    execute the code .
    REPORT zex3 .
    PARAMETERS: V_DATUM(11) TYPE C.
      DATA:     V_MON(3) TYPE C,
                V_DAT(2) TYPE C,
                V_YEAR(4) TYPE  C,
                V_FULLDATE(10) TYPE C.
    CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
      EXPORTING
        date_external                  = V_DATUM
    IMPORTING
       DATE_INTERNAL                  =  V_DATUM
    EXCEPTIONS
       DATE_EXTERNAL_IS_INVALID       = 1
       OTHERS                         = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    WRITE  V_DATUM+4(2) TO V_MON.
    WRITE  V_DATUM+6(2) TO V_DAT.
    WRITE  V_DATUM+0(4) TO V_YEAR.
    CONCATENATE V_DAT '/' V_MON '/' v_YEAR
                      INTO V_FULLDATE ."  SEPARATED BY SPACE.
    WRITE:/ V_FULLDATE.
    Regards,
    Vijay

  • MM/DD/YYYY to DD/MM/YYYY in selection screen

    hi experts,
    i have problem with date format.in my sap system date format is mm/dd/yyyy.
    when the user selects particular date in selection screen it was displaying the format mm/dd/yyyy.
    but the user wants dd/mm/yyyy format.
    please give me some idea.
    Sorry as i have gone through so many postings .
    But i didnt find any answer for this .
    Moderators please excuse, because the problem is not resolved tillnow.

    Hi Vinay,
    Always remember one thing.
    Date, Time, Currency and Quantity fields are always stored in data base without field
    seperator/decimal and thousand seperator. So what ever way u give in selection screen internal format will remain same.
    Date: YYYYMMDD
    Time: HHMMSS
    eg: Just declare a date field as select option. Enter some value and go to debug mode.
    What u r seeing in this select option low/high value?
    It will be in YYYYMMDD format correct?
    But what it is displaying in screen is as per user setting.
    Here is the solution for ur problem.
    Ask the user to change his/her user setting to DD/MM/YYYY format.
    I think this setting is not available. But they can try with DD.MM.YYYY.
    U can try this with tcode SU3. User settings will be effective from next login.
    eg: If u change ur setting now, it is valid from next logon. Try this urself and convey to the user about the same.
    Hope it helps.
    Thanks,
    Vinod.

  • Converting date format MM/DD/YYYY to DD/MM/YYYY in ISA B2B App

    Hi All,
    We have implemented CRM ISA 5.0 (B2B) application. Is it possible to change the date format to DD/MM/YYYY in ISA B2B web application. Now currently it is showing MM/DD/YYYY in all the pages. We need to change this format to DD/MM/YYYY, where and which the date shows the current format of MM/DD/YYYY. Is there any way in XCM settings to change the date format to achieve this. Do we require custom coding ?
    Kindly suggest us!!!
    Thanks and Regards,
    Saravanan

    Hi ,
    If the sol doesn't work with the system settings, do try passing the values in char format after concatenating appropriately adding "-".
    This ll work.
          date = '02252010'. "mmddyyyy"format
          concatenate date+2(2) '-'
                      date+0(2) '-'
                      date+4(4) into var.
    var-25-02-2010dd-mm-yyyy format.
    pass the variable 'var' to the webshop/web application.

  • Displaying only mm/yyyy of dd/mm/yyyy in a query.

    I have a date characteristic in my query, zstdate. Is it possible to display just the mm/yyyy and not dd/mm/yyyy? Say there is a value 01/01/2007 for this characteristic, I want to display only 01/2007 in my query result. Is this possible?

    Hello Uday,
    Its not duplicating the data. You are actually looking at the fiscal year period and not the date. If you don't really need the date & if you really want to see only fiscal year/period, then replace date char. with fiscal year/period char. If you still want the date and if you have an ODS in the data model, then date char. can be included in the ODS to look for the details.
    I hope that helps.

  • Date format from mm/dd/yyyy to dd-mmm-yyyy

    How to convert the date from 01/01/2006 to 01-Jan-2006??

    Hi sravanthi,
    1. we have to apply some logic for that,
       and use the standard FM
       'MONTH_NAMES_GET'
    2. i have an independent FORM/PERFORM
       in which we give input as some date,
       and it returns date in format
       dd-mon-yyyy.
    3. just copy paste in new program and run.
    report abc.
    DATA : mname(25) TYPE c.
    PARAMETER : d TYPE sy-datum default sy-datum.
    PERFORM getmonth USING d mname.
    WRITE :/ mname.
    FORM getmonth USING d mname.
      DATA : month_names LIKE t247 OCCURS 0 WITH HEADER LINE.
      DATA : m(2) TYPE c.
      m = d+4(2).
      CALL FUNCTION 'MONTH_NAMES_GET'
    EXPORTING
    LANGUAGE = SY-LANGU
    IMPORTING
    RETURN_CODE =
      TABLES
      month_names = month_names
      EXCEPTIONS
      month_names_not_found = 1
      OTHERS = 2
      READ TABLE month_names INDEX m.
      IF sy-subrc = 0.
        mname = month_names-ktx.
      ENDIF.
    concatenate d+6(2) '-' mname '-' d(4) into mname.
    ENDFORM. "getmonth
    regards,
    amit m.

Maybe you are looking for

  • Do I need to design on just one page for a scrolling "single page design?

    Hi I want to design a single page scrolling website but I have quite a bit of content. In Adobe Muse tutorials such as this one: http://tv.adobe.com/watch/muse-feature-tour/adobe-muse-layers-panel-may-2013/ it looked like she was designing multiple p

  • Will there be generators for Data Modeler

    Are there plans to add any generators to SQL Data Modeler? This would be similar to what we had in Oracle Designer. One of the nicest things with Oracle Designer was that we could interview the End Users, build the ERDs and FHDs based on the intervie

  • HTML Programming Question

    I'm working on creating a custom page template. I'm basing it on the template "One row of tabs with sidebar" Now for the sidebar, I'm thinking I'm going to use a DHTML Tree. Now this is where I'm not sure how I should proceed based on the requirement

  • SPAU: difference in development and on QA/PRD system

    Question from Customer: After Release upgrade and SP-application we have completed the  SPAU on the development system and after Upgrade/SPAM application of QA/PRD system  we have imported the SPAU request into the QA/PRD, but after the import there

  • Bex Query for Waterfall Report

    Hello, I've a Icube so defined: Dimensions: Data Pckg Time Unit Plant Vendor Material PVM_ID (Each Plant,Vendor,Material is linked to an ID) Navigation Attributes: Material Group Key Figures Min Qty I need to have a Variables screen with two time (Fr