Converting RichInputDate to specific format

Hi All,
greetings!!!
I am using jdev 11.1.2.1.0
I have two input date component's on my JSPX.
<af:inputDate label="From Date" id="fromDate" binding="#{DepositeLog.dtFrom}" autoSubmit="true" immediate="true">
        <af:convertDateTime pattern="#{resourceBundle['Common.shortDisplayDatePattern']}"/>
</af:inputDate>
<!--  shortDisplayDatePattern is dd-MMM-yyyy : from Resource Bundle -->
<af:inputDate label="To Date" id="toDate" binding="#{DepositeLog.dtTo}"  autoSubmit="true" immediate="true">
        <af:convertDateTime pattern="#{resourceBundle['Common.shortDisplayDatePattern']}"/>
</af:inputDate>In managed bean I am getting these dates as,
        System.out.println(this.getDtFrom().getValue());
        System.out.println(this.getDtTo().getValue());
   //Output of these 2 SOP's is,       
        Fri May 09 10:18:03 IST 2008
        Tue May 01 10:18:03 IST 2012
      Now, I want to convert these dates in the format : 09-May-2008 and 01-May-2012 i.e. in dd-MMM-yyyy format
These new dates should be of String data type.
I don't want to manually fetch the required strings with help of split()
I tried for this,
        this.getDtFrom().getMinValue();
        //which actually returns java.util.Date(), but in my case it returned null.Also,
I tried this,
        SimpleDateFormat sdf = new SimpleDateFormat("dd-mmm-yyyy");//line 1
        String toDate = this.getDtFrom().getValue().toString();//line 2
        System.out.println(sdf.format(toDate));//line 3
   //But it thrown exception:
        "java.lang.IllegalArgumentException: Cannot format given Object as a Date" for line #3Appreciate your help...
Thanks and Regards,
Madhav K.
Edited by: Madhav on May 16, 2012 10:28 PM

The following code help you to see the date on ui on given pattern which is defined in <af:convertDateTime>
<af:inputDate label="From Date" id="fromDate" binding="#{DepositeLog.dtFrom}" autoSubmit="true" immediate="true">
<af:convertDateTime pattern="#{resourceBundle['Common.shortDisplayDatePattern']}"/>
</af:inputDate>
Although in backing bean if you are getting the value of date that will not formatted.
BTW you want to format the date on backing bean.Step are
1-Create the object of SimpleDateFormat
2-call format method on newly created object
3-the method will return sting value of the formatted date
Code example is following
    public void dateValueChange(ValueChangeEvent valueChangeEvent) {
        System.out.println(datevalue.getValue());
        SimpleDateFormat sdf=new SimpleDateFormat("dd-MMM-yyyy");
       String date= sdf.format(datevalue.getValue());
       System.out.println("=========="+date);
       }

Similar Messages

  • Converting Double to Specific Format.!!!!!!

    Hi,
    I have a requirement to convert the double to a speicfic pattern.
    Example:
    Double: 1222.23 ----> if i input Mantissa=13 decimal=2
    then i want to append zeros before the Mantissa and after decimal
    a) input : Double: 1222.23 if i input Mantissa=13 decimal=2
    output: 000000000122223 -----> total 15 digits
    b) input : Double:1234.1 if i input Mantissa=7 decimal=4
    output: 000123410000 ---> total is 11 digits
    c) input : Double:123.2268 if i input Mantissa=6 decimal=2
    output: 00012322 ---> total is 8 digits
    Insted of writing a logic to get Mantissa and decimal numbers is there any method in api to get the same.
    Insted of saying to see a specific api, anyone can atleast say which method is available to proceed.
    Awaiting
    DARMA

    You really need to learn to use the javadocs...
    Here is a hint to get you started.
    setMaximumIntegerDigits()
    setMaximumFractionDigits()
    Oh, and just one point about DecimalFormat, it uses ROUND_HALF_EVEN (you can also find details of this in the javadocs)

  • Convert RichInputDate to Date object

    Hi,
    I'm using af:inputDate in my form.
    in my backing bean i'm trying to get the value as Date object.
    public RichInputDate getFromDate() {
    return fromDate;
    public void convert(){
    Date fromDt = (Date)this.getFromDate().getValue();
    but I get this error:
    java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date
    any idea?
    is there a simple way to get the value as Date object.
    Thanks!

    Converting RichInputDate to specific format
    https://kr.forums.oracle.com/forums/thread.jspa?threadID=2242338

  • Convert to a date format

    Hi,
    I have a table with a date field that comes as varchar2(20byte) with a content like this:
    20/Jan/2011
    and I need it to be converted toa real date format e.g. 20.01.2011.
    Please help,
    Thanks
    Walter

    Hi, Walter,
    user457173 wrote:
    Hi,
    I have a table with a date field that comes as varchar2(20byte) with a content like this:
    20/Jan/2011
    and I need it to be converted toa real date format e.g. 20.01.2011.'20/Jan/2011' is actually just as "real" as '20.01.2011'. Neither is a real DATE; both are strings.
    Please help,
    Thanks
    WalterUse TO_DATE to convert a string into a DATE:
    TO_DATE ( column_x
            , 'DD/Mon/YYYY'
            )Use TO_CHAR to display a DATE in a given format:
    TO_CHAR ( d
            , 'DD.MM.YYYY'
            )d can be any DATE, including the DATE returned by the TO_DATE function, above.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.
    Edited by: Frank Kulash on Oct 25, 2011 7:57 AM

  • Cannot convert PDF to any format in your drop down

    Evertime I try to concert a PDF I get a "conversion Failure" PDF containing XFA forms cannot be saved to that specific format. What do i need to do? When I send the PDF noone can open it thats why I want to convert to something else.

    Hi ARM132,
    ExportPDF cannot convert PDF files containing XFA forms. Please see: Can't export a PDF with XFA formf
    Best,
    Sara

  • Converting varchar2 to date format

    I've converted date formats many times, but for some reason I'm getting an invalid number error when trying to convert a varchar2 column. I've tried the to_char and to_date function and I get the same result. The column is a date and it is formatted as DD-MON-YYYY, but I want to change it to MM/DD/YYYY. My query is below:
    select to_date('fccpdate','MM/DD/YYYY')
    from cc_class_scmast_v
    When I try to_date I get this:
    Error starting at line 1 in command:
    select TO_DATE('fccpdate', 'DD-MON-YYYY') from cc_class_scmast_v where fccpdate IS NOT NULL
    Error report:
    SQL Error: ORA-01858: a non-numeric character was found where a numeric was expected
    01858. 00000 - "a non-numeric character was found where a numeric was expected"
    *Cause:    The input data to be converted using a date format model was
    incorrect. The input data did not contain a number where a number was
    required by the format model.
    *Action:   Fix the input data or the date format model to make sure the
    elements match in number and type. Then retry the operation.
    When I try to_char I get this:
    Error starting at line 1 in command:
    select TO_char('fccpdate', 'DD-MON-YYYY') from cc_class_scmast_v where fccpdate IS NOT NULL
    Error report:
    SQL Error: ORA-01722: invalid number
    01722. 00000 - "invalid number"
    *Cause:   
    *Action:
    I've tried removing the single quotes from my column and that doesn't make a difference. Any help is appreciated.

    Hi,
    housetiger77 wrote:
    I've converted date formats many times, but for some reason I'm getting an invalid number error when trying to convert a varchar2 column. I've tried the to_char and to_date function and I get the same result. The column is a date and it is formatted as DD-MON-YYYY,If the column is a DATE, then it has the same format that all DATEs have, which is nothing like 'DD-MON-YYYY'. Formats like that only apply to strings.
    Conversely, if it is formatted as 'DD-MON-YYY', then it is a string, not a DATE.
    but I want to change it to MM/DD/YYYY. My query is below:
    select to_date('fccpdate','MM/DD/YYYY')
    from cc_class_scmast_vTO_DATE (x, 'MM/DD/YYYY') tries to convert the string x into a DATE. Let's say it starts by taking the first 2 characters of x, to get the month. The first 2 charcters of 'fccpdate' are 'fc', which is not a valid number (at least not in base 10), let alone a number between 1 and 12, so TO_DATE raises an error.
    When I try to_date I get this:
    Error starting at line 1 in command:
    select TO_DATE('fccpdate', 'DD-MON-YYYY') from cc_class_scmast_v where fccpdate IS NOT NULL
    Error report:
    SQL Error: ORA-01858: a non-numeric character was found where a numeric was expected
    01858. 00000 - "a non-numeric character was found where a numeric was expected"
    *Cause:    The input data to be converted using a date format model was
    incorrect. The input data did not contain a number where a number was
    required by the format model.
    *Action:   Fix the input data or the date format model to make sure the
    elements match in number and type. Then retry the operation.
    When I try to_char I get this:
    Error starting at line 1 in command:
    select TO_char('fccpdate', 'DD-MON-YYYY') from cc_class_scmast_v where fccpdate IS NOT NULL
    Error report:
    SQL Error: ORA-01722: invalid number
    01722. 00000 - "invalid number"
    *Cause:   
    *Action:
    I've tried removing the single quotes from my column and that doesn't make a difference. Any help is appreciated.That's a good first step. Literals are enclosed in single-quotes, identifiers (including column names) are not. 'fccpdate' is the literal 8-character string containing 'f', 'c;, another 'c', 'p', 'd', 'a', 't' and 'e'. fccpdate (without single-quotes) can be the name of a column.
    If fccpdate is a string, such as '18-JUL-2012', then you can convert it to a DATE using TO_DATE.
    TO_DATE (fccpdate, 'DD-MON-YYYY')If you want to display a DATE in a particular format, use
    TO_CHAR ( d
            , f
            )where d is a DATE, and f is the format string. In this case, d might be the TO_DATE expression above
    TO_CHAR ( TO_DATE (fccpdate, 'DD-MON-YYYY')
            , 'MM/DD/YYYY'
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.
    See the forum FAQ {message:id=9360002}

  • How to convert Milliseconds into Date format

    Hi all,
    I am getting the output of a variable in milliseconds format, how can I convert it into date format
    For ex: I am getting input variable as 1366664691000 and I need to convert it to April 22, 2013 5:04:51 PM EDT ( or of SOA format). is there any function for this in XSL or XPath?
    Thanks,

    It is working fine if i test it in provided site...
    But it is returning "-1366664691001", If i am running it in EM. This is the code in my xsl
    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
    <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
    <mapSources>
    <source type="WSDL">
    <schema location="../JavaProcess.wsdl"/>
    <rootElement name="process" namespace="http://xmlns.oracle.com/SampleApplication/JavaEmbeddingActivity/JavaProcess"/>
    </source>
    </mapSources>
    <mapTargets>
    <target type="WSDL">
    <schema location="../JavaProcess.wsdl"/>
    <rootElement name="processResponse" namespace="http://xmlns.oracle.com/SampleApplication/JavaEmbeddingActivity/JavaProcess"/>
    </target>
    </mapTargets>
    <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.4.0(build 110106.1932.5682) AT [TUE MAY 07 10:21:02 EDT 2013]. -->
    ?>
    <xsl:stylesheet version="1.0"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
    xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:med="http://schemas.oracle.com/mediator/xpath"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:bpmn="http://schemas.oracle.com/bpm/xpath"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:client="client"
    exclude-result-prefixes="xsi xsl bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref bpmn ora socket ldap">
    <xsl:template match="/">
    <xsl:variable name="lastMTime" select="1366664691000"/>
    <xsl:copy-of select="$lastMTime"/>
    <client:processResponse>
    <client:result>
    <xsl:value-of select='xsd:dateTime("1970-01-01T00:00:00") + $lastMTime * xsd:dayTimeDuration("PT0.001S")'/>
    </client:result>
    </client:processResponse>
    </xsl:template>
    </xsl:stylesheet>

  • Extract text with specific format ?

    Hello,
    Is there a way to extract text with a specific format in a document (i.e. font type/ size or even font colour)?
    thanks in advance!

    Hello gillad,
    I am afraid only indicators are the bold font or text colour...
    Having said that, just as I was writting my response, the following idea came to me:
    Convert the pdf into word
    Click on text of interest (text with distinct format)
    Use the feature "select all text with similar formating (no data)" under "editing" within the "home" ribbon
    Having said that, hopefully a tool set/ action can be developed one day...

  • I am on windows 8 platform, i used adobe elements to work on my image - the output is in dng format, how do i convert this to jpg format?

    i am on windows 8 platform, i used adobe elements to work on my image - the output is in dng format, how do i convert this to jpg format?

    When you make a DNG that's like making another raw file, so you will need to convert the DNG file just like your original raw. Don't use the Save button in the raw converter. That's just a link to the DNG converter. Normally you would click Open instead and then save in the editor as a jpg or other image format of your choice.

  • How to upload a PDF file and convert it to OTF format

    We have come across rquirements like converting OTF to PDF but my requirement is to read a PDF file in SAP and convert it to OTF format for printing.
    Can anyone please help me with the Function Modules to do so.

    Hello,
    Try the following FM:
    CONVERT_OTF Convert SAP documents (SAPScript) to other types.
    Example:
    CALL FUNCTION "CONVERT_OTF"
    EXPORTING FORMAT = "PDF"
    IMPORTING BIN_FILESIZE = FILE_LEN
    TABLES OTF = OTFDATA
    LINES = PDFDATA
    EXCEPTIONS ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    OTHERS = 4.
    Hope this helps.
    Reward if helpful.
    Regards,
    Vasanth

  • How to conver a BINARY Table in specific format Documento to send by e-mail

    Hello all
    i am trying to send a file that is located in application server, this file was created in BINARY MODE, so now i need to download from this server and then send it by e-mail, i haver already download in BINARY MODE but when i send it and i open this appears in BINARY MODE i need to see in the specific format, for example:
    I have a FILE.XLSX which is BINARY MODE in the server and i used this function to download it
    CALL FUNCTION 'C13Z_RAWDATA_READ'
        EXPORTING
          i_file           = input_file
        IMPORTING
          e_file_size      = lv_file_size
          e_lines          = lv_lines
        TABLES
          e_rcgrepfile_tab = it_tab
        EXCEPTIONS
          no_permission    = 1
          open_failed      = 2
          read_error       = 3
          OTHERS           = 4.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
        w_doc_data-doc_size = lv_file_size.
        LOOP AT it_tab INTO wa_itab.
          t_attachment-line   = wa_itab-orblk.
          APPEND t_attachment.
        ENDLOOP.
      ENDIF.
    fter to recive the file in binary mode i move it to the internal table  t_attachment, after that i send it by e-mail,
    w_doc_data-obj_langu  =  sy-langu.
      w_doc_data-obj_name   =  'EDISO'.
      w_doc_data-obj_descr  =  ld_mtitle.
      w_doc_data-sensitivty =  'F'.
    *--> Crea el cuerpo del mensaje
      t_packing_list-transf_bin =  space.
      t_packing_list-head_start =  1.
      t_packing_list-head_num   =  0.
      t_packing_list-body_start =  1.
      DESCRIBE  TABLE  it_mensaje  LINES  t_packing_list-body_num.
      t_packing_list-doc_type  =  'RAW'.
      APPEND  t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin  = space. "'X'.
      t_packing_list-head_start  =  1.
      t_packing_list-head_num    =  1 ."5.
      t_packing_list-body_start  =  1. "5.
      IF t_attachment[] IS NOT INITIAL.
        DESCRIBE  TABLE  t_attachment  LINES  t_packing_list-body_num.
        t_packing_list-doc_type   =  c_format. THIS IS THE FORMAT I NEED TO SEE THE FILE FOR EXAMPLE: XLSX
        t_packing_list-obj_descr  =  ld_attdescription.
        t_packing_list-obj_name   =  ld_attfilename.
        t_packing_list-doc_size   =  t_packing_list-body_num * 255.
        APPEND  t_packing_list.
      ENDIF.
    But when i open the mail and open the file attach appears in BINARY so i need to see in XLSX format,
    Thanks a lot for you help

    Thanks for you help

  • Convert Char to Date format - Evaluate

    Hi,
    Could anyone provide us the Evaluate formula to convert Char to Date format
    2009-06-20 should be converted to 06/20/2009
    Regards,
    Vinay

    Hi,
    Refer the below threads...
    Re: How to convert string to date format?
    how to convert character string into date format????
    Regards,
    Chithra Saravanan

  • After Effects CS4 and converting to a lossless format

    I posted in the Adobe Premiere forums about an issue I was having with my renders. If you want to read it then you can check it out with the url below.
    http://forums.adobe.com/message/2622969#2622969
    What I have figured out is that After Effects does not like my AVCHD files I get from my camera. (They are h.264 in an ,m2ts file type and not mp4)
    The issue is that I get "echos" or skips when I render something in After Effects or render with Media Encoder via dynamic link and Premiere Pro CS4.
    What I am not familar with is the types of files that many of you who are more expereinced than I am use for After Effects when you need to convert to a lossless format (or one as close as you can get to being "lossless."
    I was wondering if someone could recommend the kinds of files I should be converting to and if you have a good method of converting them. Not that I want people to discuss other software here, but if you do not use Adobe programs to convert, then what kinds of files do you convert to?
    In other words, where do you recommend I begin reading or researching this because a lot of companies sell conversion programs. I currently have one that I paid for but it does not do the job I need it to do for HD. I would like to keep it as close to HD quality as possible.
    FYI I generally will do video work with some effects and green screen work in After Effects. My output is video. If you have any other questions about my process, then please do not hesitate to ask me. Other than that, I appreicate anyone's guidance.

    Yeah, AE does not like video files with interframe compression. It processes video in a completely different way than a non-linear editing program like Premiere does. My friend Dave LaRonde from the friendly forums at CreativeCOW.net explains it this way:
    If the footage you imported into AE is any kind of the following -- footage in an HDV acquisition codec, MPEG1, MPEG2, mp4, m2t, H.261 or H.264 -- you need to convert it to a different codec.
    These kinds of footage use temporal, or interframe compression. They have keyframes at regular intervals, containing complete frame information. However, the frames in between do NOT have complete information. Interframe codecs toss out duplicated information.
    In order to maintain peak rendering efficiency, AE needs complete information for each and every frame. But because these kinds of footage contain only partial information, AE freaks out, resulting in a wide variety of problems.
    You have experienced this delightful problem for yourself.
    There are several different file formats that people use. Uncompressed AVI is one as is Quicktime with the animation codec. However, lately folks seem to prefer Quicktime with the PNG codec (not a PNG sequence). It produces a significantly smaller file size, but is still effectively lossless.
    You can use the Adobe Media Encoder to export it out of Premiere to use in AE.

  • Can't convert .DV to any format in Quicktime

    Hi!
    I've recently created a movie project in iMovie and exported it to Quicktime, for it to keep it's full resolution. The problem is... the file measures about 1.09 Gb, for a 5:49 movie. I want to convert it to .avi to reduce it's size, maintain quality and play on YouTube, etc,; I've tried different specs but it always freezes! I've tried also converting it to different formats like Divx or .mp4 but with no luck at all. Any tips on how to fix this?

    First don't export to AVI there are enough horrible AVI's out there from Windows users to last until the 22nd century.
    You don't need to export it at all just open the reference file in QT and export how you like. You have said nothinga about how it doesn't work, error messages or anything at all to help so try doing that.
    DV is 13GB an hour so the size is simply a normal DV size for the duration you have there, and not a problem, and you may be happier opening it in MPEG Streamclip (free), and export to MPEG-4 with one of the iTunes presets.

  • I've uploaded 4 pdf documents. Now how do I convert them to Excel format?

    I've uploaded 4 pdf docs. Now how do I convert them to Excel format so I can manipulate the data?
    linda93790

    Hi linda93790,
    If you uploaded your files to http://cloud.acrobat.com, simply click on one of the PDF files, then click 'ExportPDF' from along the top-bar in your browser.  This will automatically load that PDF into the ExportPDF system.  From there, you can configure any options you may need and convert the file to an .xlsx file.
    Please let us know if you have any questions!
    Thanks,
    David

Maybe you are looking for

  • How to format and display xml file as displayed in IE

    I want to display the xml file as it is displayed in Internet Explorer. Which component I should use and how? Thanks in advance Sachin

  • To add a new Column in ME21 item screen

    Hi, We need to add a new column at item level of the transaction ME21. Does adding the new column refres to adding the new field in the EKPO table as an include structure? or Is there any screen exits which could be used. Thanks in advace.

  • How to add a copyright to a photo in Aperture?

    I just downloaded the trial version of Aperture 2, to get a feel for it. I do a lot of photography, and need a simple way to add a copyright mark on the photo itself, i.e., my name, the year, and the copyright symbol. Under metadata, I typed in "©200

  • How do I auto-arrange more than one Finder window?

    I know a SIMILAR question has been asked in another thread: http://discussions.apple.com/thread.jspa?threadID=264062&tstart=0 and that particular question was answered, but seeing as though my question is slightly different, I thought it would best t

  • Java - too many levels of symbolic links

    Hi everyone, Today I've tried to launch eclipse and I noticed this strange error : [^81%][11:12][cafe][~]$ eclipse /usr/bin/java: line 2: /usr/lib/jvm/default/bin/java: Too many levels of symbolic links /usr/bin/java: line 2: exec: /usr/lib/jvm/defau