UNPARSABLE Date

Hi i am using JDEV 11.1.1.3
i have a rich input date in my form....
i getting the value in my backing bean in string format
String ProjStartDate = getId4().getValue().toString();
getting value in this format
"Sun Mar 06 00:00:00 IST 2011
want 2 covert into java.util.date,i tried
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
java.util.Date ConvProjStartDate = dateFormatset.parse(ProjStartDate);
i tried different format also....
but i am getting error as UNPARSABLE DATE
please suggest me a solution
Edited by: Venkat L Naidu on Mar 22, 2011 11:32 PM

try this:
SimpleDateFormat formatter=
new SimpleDateFormat("MM-dd-yyyy");
String strDate = formatter.format(this.id1.getValue());

Similar Messages

  • SimpleDateFormat.parse() causes Unparsable date exception

    I am using SimpleDateFormat to both format and parse date strings. The format is working properly, but parse results in the following exception:
    java.text.ParseException: Unparseable date: "2007-08-31T12:05:05.651-0700"
    at java.text.DateFormat.parse(Unknown Source)
    Here is my code:
    SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ss.SZ");
    String dateTime = dateFormatter.format(new Date());
    Date test = dateFormatter.parse(dateTime);
    For testing purposes, I am formatting a date string, and then passing it right back into parse() and I get the exception.
    I am using jre1.5.0_10.
    Thank you for your help.
    -Karen

    You have specified the milliseconds (S) to have a minimum of 1 letter.
    From the API:
    Number: For formatting, the number of pattern letters is the minimum number of digits, and shorter numbers are zero-padded to this amount. For parsing, the number of pattern letters is ignored unless it's needed to separate two adjacent fields.
    If you specify it like this:SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ss.SSSZ");
    // or like this
    SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ss.S Z");it will work.
    Message was edited by:
    dwg

  • Unparsable date "yyyy-MM-dd" in Windows Arabic OS

    Hi Guys,
    I have one problem. Plese help me regarding in this. I am not able to parse the date format like "yyyy-MM-dd" in Windows XP Arabic OS environment.
    But the same thing is working fine in Windows XP English OS. I am using jdk version is j2sdk1.4.2_15. My sample program like below:
    import java.text.*;
    import java.util.*;
    public class DatePro2{
    public static void main(String[] args)throws Exception{
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    System.out.println(format.parse("2008-02-21"));
    This is the exception i am getting java.text.ParseException: Unparseable date: "2008-02-21"
    Is this the problem with JDK installed in Windows XP Arabic Operating System? or JDK Bug?. Please explain me clearly
    Thanks in advance

    sureshpatike wrote:
    Please help anybody to me regarding the problem of date issue in arabic windows OS environment. problem description is on top. please help help...Construct the SimpleDateFormat for a Western Locale (England, France, USA etc) and make sure you specify the TimeZone for which the date applies.
    Edited by: sabre150 on Feb 25, 2008 11:07 AM

  • Unparsable date exception

    Hi,
    I am getting exception "Unparseable date: "Thu May 21 18:16:42 IST 2009"" while changing my regional setting to turkey
    Exception occured by following statement
    SimpleDateFormat myDateFormat = new SimpleDateFormat(sFormat,Locale.getDefault());
    myDate = myDateFormat.parse(sDateValue);
    what would be the problem, can any body help me
    Thanks
    Tej Kiran

    TejKiran wrote:
    i am using sFormat is "E MMM dd hh:mm:ss z yyyy"I don't know if you're still around. But for what it's worth:
    "MMM" means "month in text format, abbreviated".
    When you use that with a turkish locale, then the turkish names for the months will be used. So your english-language dates won't be parsed correctly.

  • Date contructor deprecation : Parsing a String to Date

    Hi All,
    In Java 1.5 the Date() constructor Date(String s) is deprecated. As per the API Documentation DateFormat.Parse() method is used.
    The following code from Java 1.4 version has to be upgraded to Java 1.5.
    Existing Code:
    Date dDate = new Date(sDate);
    Modified Code:
    DateFormat df = DateFormat.getDateInstance();
    Date dDate = df.parse(sDate);
    Here the DateFormat accepts a default formatting style as "Feb 01, 2007" and parses the String.
    If the String sDate belongs to any other formatting style such as "01 Feb, 2007" or "01 Feb, 07" the code piece throws unparsable date error.
    Please give your thougts on this issue to parse the string of any format..
    Thanks,
    Rajesh.

    Hi All,
    In Java 1.5 the Date() constructor Date(String s) is
    deprecated. As per the API Documentation
    DateFormat.Parse() method is used.
    The following code from Java 1.4 version has to be
    upgraded to Java 1.5.
    Existing Code:
    Date dDate = new Date(sDate);
    Modified Code:
    DateFormat df = DateFormat.getDateInstance();
    Date dDate = df.parse(sDate);
    Here the DateFormat accepts a default formatting
    style as "Feb 01, 2007" and parses the String.
    If the String sDate belongs to any other formatting
    style such as "01 Feb, 2007" or "01 Feb, 07" the code
    piece throws unparsable date error.
    Please give your thougts on this issue to parse the
    string of any format..You can't. What date is this: "08/04/24"? 8 April, 1924? 4 August, 2024?
    >
    Thanks,
    Rajesh.

  • How to insert date value through xml in oracle

    hi,  I am inserting data using xml string. Everything is working perfect but it shows error when i try to insert data into a table with date coloumn. it shows unparsable date error.... I am using this format of date 1-jan-2011
    my prcedure and java method is as follows...
    CREATE OR REPLACE procedure app_data.Insert_callrepHeader(xmlDoc in CLOB,t_id out varchar2,flag out varchar2) is
    insCtx DBMS_XMLSave.ctxType;
    rows number;
    t_tablename VARCHAR2(300);
    t_seqval varchar2(100);
    begin
    t_tablename:='T_CALLREPORT_HDR';
    insCtx := DBMS_XMLSave.newContext(t_tablename);
    rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc);
    dbms_output.put_line(to_char(rows) || ' rows inserted');
    DBMS_XMLSave.closeContext(insCtx);
    select SEQ_T_CALLREPORT_HDR.currval into t_seqval from dual;
    dbms_output.put_line(to_char(t_seqval) || ' is the current sequence number');
    end;
    public void insertAll(String[][] dbTblFieldValues) throws Exception
    Connection conn=null;
    conn=getOracleConnection();
    try
    String str="<ROWSET>"+
    "<ROW>"+
    "<PROCESSNAME>sheet</PROCESSNAME>"+
    "<FK_EMPID>1</FK_EMPID>"+
    "<FK_JRNY_PLAN_HDR_ID>278</FK_JRNY_PLAN_HDR_ID>"+
    "<FK_DIVISIONID>3</FK_DIVISIONID>"+
    "<STARTDATE>7-may-2011</STARTDATE>"+ what should be the format of this date????_+
    "<COMMENTSFORWEEK>comment</COMMENTSFORWEEK>"+
    "<SAPCODE>mysapcode300</SAPCODE>"+
    "<WEEKNO>1</WEEKNO>"+
    "<TOTALEXPENSE>800</TOTALEXPENSE>"+
    "<VENDORINVOICETYPE>mytype</VENDORINVOICETYPE>"+
    "<REPORTNO>1</REPORTNO>"+
    "<SUBPROCESSID>800</SUBPROCESSID>"+
    "</ROW>"+
    "</ROWSET>";
    StringBuffer sb = new StringBuffer(400000);
    sb.append(str);
    String clobValue = sb.toString();
    PreparedStatement preparedStatement=conn.prepareStatement("{call INSERT_CALLREPHEADER (?,?,?)}");
    preparedStatement.setString(1, clobValue);
    preparedStatement.setString(2,null );
    preparedStatement.setString(3,null );
    preparedStatement.execute();
    preparedStatement.close();
    conn.close();
    catch (Exception e) {
    // System.out.println(e.getMessage());
    e.printStackTrace();
    }

    I have got the answer...
    use DBMS_XMLSave.setdateformat(insCtx, 'dd-MM-yyyy'); and u can change ur date format....

  • Php - Data - Flash

    Hi all,
    this is my first post I'm a newbee teaching myself, so i hope
    I'm Clear
    I have No problems inserting data from flash to PHP into
    MySQL,
    it's sendind them back properlly.
    All I'd like to see happen is for one row of data to be
    inserted into a dynamic text field.
    here's what i've got
    if i access this php file, it prints out a vertical list from
    a single MySQL row,
    I was happy.
    $query = "select row from table";
    $result = mysql_query($query, $db);
    while($row = mysql_fetch_row($result))
    print "$row[0]<BR>\n";
    From flash :
    I created a dynamic text field w/ an instance, my_to.
    var lv:LoadVars = new LoadVars();
    lv.load ("data.php");
    lv.onLoad = function(){
    my_to.text = lv;
    and Instead of the vertical list (which i would love to see)
    i get an unparsed data array.
    I can't imagine i'm to far off,
    what am I missing?
    I hope not alot
    Alex

    You should use amfphp. It's flash remoting with php. It's
    much cleaner integration.
    http://www.amfphp.org
    Otherwise, to use loadvars, you have to export your data from
    php like this: "name1=$row[0]&name2=$row[1]..."
    then in flash use: lv.name1 will equal $row[0]

  • Urgent - Adf input Date

    dear All :
    i am using ADSf 10 with WLS 11
    i have the following problem :
    i add inputdate feild into my screen and i read it is data in the backing bean ,
    but i have the following format : Thu Aug 19 00:00:00 IDT 2010
    i try to use simple date or any other formates to convert this date into dd/mm/yyyy format but every time the following message appear in server log :
    java.text.ParseException : Unparsable date "Thu Aug 19 00:00:00 IDT 2010:i need your help
    Edited by: bara on Aug 15, 2010 1:11 AM

    i use the following :
       <af:inputDate label="To Date" id="id2" autoSubmit="true"
                                  immediate="true"
                                  valueChangeListener="#{BBCampaigsReport.getToDate}"
                                  simple="true">
                    <af:convertDateTime pattern="yyyy/M/d" secondaryPattern="d/M/yyyy" />but it still the same

  • Adf input Date

    dear All :
    i am using ADSf 10 with WLS 11
    i have the following problem :
    i add inputdate feild into my screen and i read it is data in the backing bean ,
    but i have the following format : Thu Aug 19 00:00:00 IDT 2010
    i try to use simple date or any other formates to convert this date into dd/mm/yyyy format but every time the following message appear in server log :
    java.text.ParseException : Unparsable date "Thu Aug 19 00:00:00 IDT 2010:i need your help

    duplicate Urgent - Adf input Date

  • Exists function

    Hi All,
    My requirement is souce field format(MM/dd/YY) convert it to target field format(dd-MM-yyyy). I used Date Trans function to achieve the same. The problem is some times the source field may not contain any value. So, I tried exists function some thing like this.
    src>exists>input to if functon
    src>dateTrans>input to then part of if function.
    constant(blank)-->input to else part of if function
    Output of if function-->target field.
    The problem here is if the the input field is empty, again it is exeuting the DateTrans function and error"Unparsable date".
    Pls let me know where I am going wrong...
    Thanks & Regards,
    Jai Shankar.

    Hi,
    Yes if you have occurance 1..1 you just need to check for "" blank value thats enough.
    Source             Source
            Equals-->IfWithElse-->Target
    Constant("")        Constant("")
    Regards,
    Prakash

  • Time formatter in uix

    After creating a custom formatter class that extended
    oracle.jbo.format.Formatter and made an entry into
    C:\jdev9052\jdev\system9.0.5.2.1618\formatinfo.xml. When running the TEST in
    the AppModule , the formatter worked. When testing an uix page the custom
    formatter did not work.
    Format a date field to display time only (format mask "hh:mm a")

    You may want to look at the FlexiDate implementation:
    problem deploying bc4j project with FlexiDate domain
    I found it very helpful, although I did not use the FlexiDate as a custom Domain. I took some of the code and created a utility class to help me parse and unparse dates and times into transient text fields.

  • Multiple patterns for one SimpleDateFormat???

    Newbie so be nice! :)
    I am using the following formatter to define a SimpleDateFormat:
    private static SimpleDateFormat theFormatter;
         static {
              theFormatter = new SimpleDateFormat("yyyyMMdd");
              theFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
              theFormatter.setLenient(false);
    This works fine when the date submitted is in the format "yyyyMMdd" however sometimes the date is submitted in the format "yyyy-MM-dd" and when this happens I get an error saying unparsable date when I try to parse my date later on.
    Is there a way I can set two patterns for a SimpleDateFormat or can anyone suggest a way of solving this problem?

    flobabob wrote:
    Newbie so be nice! :)
    I am using the following formatter to define a SimpleDateFormat:
    private static SimpleDateFormat theFormatter;
         static {
              theFormatter = new SimpleDateFormat("yyyyMMdd");
              theFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
              theFormatter.setLenient(false);
    This works fine when the date submitted is in the format "yyyyMMdd" however sometimes the date is submitted in the format "yyyy-MM-dd" and when this happens I get an error saying unparsable date when I try to parse my date later on.
    Is there a way I can set two patterns for a SimpleDateFormat or can anyone suggest a way of solving this problem?Create two SimpleDateFormats, one for each pattern. Check the length or for the existance of a "-" and then use the appropriate SimpleDateFormat.

  • Javascript  and ehlp introduced into source files

    RH "stops responding" and closes-whenever it encounters one--making minor changes on a few topics has forced me to relaunch RH 30 times or more yesterday.
    Projects were generated with different versions of RH (5, 6,7,8) and I've been updating them (I apply a common .css by selecting all the topics in the topic list to each project by filey . Some were taken out of the RH versioning server. I've been working several inherited projects that were hastily converted into single source RH HTML 8 projects. The conversion, I think, is introducing certain kinds of javascript?  Until today, I thought the previous contributors were saving the published files because of messed up javascript.
    <style type="text/css">/*<![CDATA[*/ A:visited {color: #800080;} A:link {color: #0000ff;}/*]]>*/</style>
    (putting the above script into this forum message causes java another java function ($A(arguments))) to display in a tooltip for the cursor as I type)
    The scripting is not in all topics; certain editing actions cause RoboHelp HTML to shut down--perhaps it is editing a topic that LINKS to such a topic; can't say for sure. I have had a dickens of a time cleaning the gunk out of files: I do know that some topics have kadov tags nested in HTML tags, nested inside css styles (i.e. 3 ways to indicate <b> bold.
    I've put the css file through http://www.w3schools.com/site/site_validate.asp and when I run the validated css in the RH project, some styles get redefined. Any ideas on how to clean up the 990 topics in the project I'm working on this week?
    I had the same kinds of issues on a different project last week. What is an effective way to clean the scripts out of topic files?  The example above is broken into 2 to 6 lines, just before the <body> tag. Additonal js may occur in the footer, or in a numbered procedure. Not all topics, not all numered procedures.  There are 3 kinds of  < js start>   < js end > tags in various files.  I've been using InfoRapid Search and Replace (it can search across line breaks) but failed to spot EVERY script.

    Hi,
    The CDATA means unparsed data. This can be used for javascript, but you can use it for any data you need. If a chunk of data uses characters that are defined in the XHTML file system, a program may not be able to read the file. With the CDATA command, the program will correctly read the string.
    If what you posted is the text added, RH doesn't add javascript, it adds css. In this case the colour of visited hyperlinks and the colour of unvisited hyperlinks.
    You say you validated your css using the W3C validator. Is it validated, or are there errors? Also, the validator only checks your css, it doesn't change it. I don't see what RH would do to a css you've only validated. Can you be more specific?
    Have you run "Update DHTML Effects in Topics"? This feature may solve a lot of your problems. Just backup your projects first.
    For find and replace, try using dnGrep (http://code.google.com/p/dngrep/). It supports regular expressions and multi line search and it saved me a couple of times. I don't know the tool you're using, so I don't know why it can't find the text. Backup your projects before using this tool.
    Greet,
    Willam

  • Java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Opti onal feature

    in my project i wanted insert a date object to the database for that i am using PreparedStatement.setDate(fieldNum,dateObject), i tried out the code segmets and used the java.sql.date onject only but i am gettig the exception"java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented".see the code below which i used
    String sql = "insert into debug (filing_date) values (?)";
    PreparedStatement insertPS = dbConn.prepareStatement(sql);
    String dateS = "2001-00-01"; //That's jan 1, 2001
    java.sql.Date date = java.sql.Date.valueOf(dateS);
    insertPS.setDate(1,date);
    insertPS.executeUpdate();
    @@@@@@@@@@@@ i tried using this way also to get into the real format "MMM d, yyy"but got the exceptoin this time also, the code is
    MMM d, yyy format, which java.sql.Date doesn't accept: String dateIn = "January 1, 2001"; String formatIn = "MMM d, yyyy"; // format of incoming string
    //parse the date using java.util.Date classes
    ParsePosition pp = new ParsePosition(0);
    SimpleDateFormat sdfi = new SimpleDateFormat(formatIn);
    java.util.Date date = sdfi.parse(dateIn,pp);
    if( date == null ) (throw new RuntimeException"Unparsable date: "+dateIn);
    //convert a java.util.Date to a java.sql.Date
    java.sql.Date sqlFromLong = new java.sql.Date(date.getTime());
    //output is: 2001-01-01 System.out.println("sqlFromLong (java.sql.Date): "+sqlFromLong);
    pls help me regardig this thanks in advance susanth

    Same question at the ranch...
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=3&t=009727

  • OIM: trusted source reconciliation - user deletion

    Hello,
    I am working on a test scenario with Oracle Identity Manager 9.1.0.1.
    I have succesfully setup trusted source reconciliation with Oracle 10g Database using the "Database Application Tables Release 9.1.0 connector".
    In the DB resides a HR table with users.
    When the data in the HR table is edited and updated everything works fine it get's reconciled to OIM.
    But when a user get's deleted from the Database HR table. The user isn't deleted in OIM
    How is that possbile?
    Your response is greatly appreciated!
    Thank you very much in advance!

    OK i have now managed the problem with the first unparsable error syntax.
    According to here (http://download.oracle.com/docs/cd/E11223_01/doc.910/e11194/create.htm):
    Database Date Format parameter for reconciliation:
    Enter the same value that you enter for the Source Date Format parameter.
    I entered the settings bellow and it works.
    Database Date Format: DD-MMM-YY
    Source Date Format: DD-MMM-YY
    Another problem:+_
    Now i have a problem with the "hire end" date, because if a user is still employed, there is a null value in the Oracle 10g DB.
    And i get Unparsable date: "" error
    Please help.

Maybe you are looking for