Help :  Simple Date Formats Problem in JDev11 [TP4] ?

Hi ;
I use ADF/JSF in JDeveloper 11 [TP4].
in JSF Page
what can I do to enter Date format mask dd-mm-yyyy hh:mi:ss
to Return my Date Format mask like
mi-mm-yyyy meaning minute-month-year
in another column ?
and I know The format mask is defined in a File called formatinfo.xml .
Thanks & Regards
Forakora

Hi,
if it is for display then you don't need to change it in the model but can link the output text component to a managed bean that gets the stored date value to then change it to the format you prefer. This however may not be suitable if the date should be updated from that column

Similar Messages

  • Simple Date Format problem

    I am having trouble with the following code. It works fine on one computer but not on another.
    Calendar cal = Calendar.getInstance(TimeZone.getDefault());
    Date date22 = cal.getTime();
    System.out.println(date22);
    String details = sdf.format(date22);
    System.out.println(details);
    StringTokenizer str = new StringTokenizer(details, "-", false);
    The working ones output is:
    Thu Jul 14 12:06:33 GMT 2005
    14-07-2005-12-06-33
    However on the computer where it doesn't work, I get this:
    Fri Aug 05 13:13:59 BST 2005
    Exception in thread "Thread-0" java.lang.NullPointerException
    Which point to line: String details = sdf.format(date22);
    From what I can see, the only difference is BST instead of GMT, but I can't seem to change this.
    It is running under Windows.
    Any help will be MUCH appreciated, as I am stumped!
    Thanks. :)

    The difference is that in the latter sdf is never assigned a non-null value. Since you didn't post the code that initializes sdf, we've got no way of knowing what went wrong.

  • Date Format problem...

    Hi users,
    Forte version : 2.e.2 and ForteWebSDK
    Datacase : Oracle
    We have a problem with a simple HTML text field which acccepts
    a date. When we try to update the record with some date, the following
    exception occurs:
    24-Jun-1998 04:32:28 : XV01086 : Execute failed for SQL statement in
    project Rap
    tServices, class RaptSqlMethods, method updateActivity, methodId 104,
    line 51, e
    rror from database is:
    ORA-01830: date format picture ends before converting entire input
    string
    The Oracle manual says that the above exception occurs when there are
    some extra characters on that field, which is not the case. In fact,
    we raise our own exception for the cases like : o1-Apr-1997,
    01-apr-97 etc. The correct format is 01-apr-1998.
    Same date soemtimes is added to the database successfully. Waht I mean
    to say that the exception deos not occur consistently.
    We just conevert the String taken from the HTML field into a Forte
    DateTimeData Object and send it to database. May be, the conversion
    part is causing the problem. But, once again the problem is not
    consistent.
    Any ideas in this will be appreciated.
    Thanx in advance
    -Rajeev Talwar
    Get Your Private, Free Email at http://www.hotmail.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    We had the same problem when our application first went live. The
    default date format for our Oracle database is 'dd-mmm-yy' without the
    time component. The default format for datatype DateTimeData is
    'dd-mmm-yyyy hh:mm:ss'. Since we did not want to change the default date
    format for the Database, we included in our service partitions an Alter
    Session statement to change the NLS_Date_format attribute in Oracle to
    conform to the Forte DateTimeData format. It worked.
    Kam Chow
    Mazda Australia
    -----Original Message-----
    From: Gary F Giger [mailto:[email protected]]
    Sent: Thursday, June 25, 1998 4:11 AM
    To: Rajeev Talwar
    Cc: [email protected]
    Subject: Re: Date Format problem...
    I was having the same problem a few weeks back when I would
    read/write
    dates to Oracle. I was using objects of type DateTimeData and I would
    occasionally get errors like you said you were. I found discovered my
    problem. Sometimes I would process a null date and would get an error.
    So to
    resolve this issue, I simply changes my objects of type DateTimeData to
    type
    DateTimeNullable. This enabled my Forte Application to handle regular
    dates
    as well as null dates. I have not gotten any oracle errors since then
    with
    regards to dates. Hope this helps.
    Rajeev Talwar wrote:
    Hi users,
    Forte version : 2.e.2 and ForteWebSDK
    Datacase : Oracle
    We have a problem with a simple HTML text field which acccepts
    a date. When we try to update the record with some date, the following
    exception occurs:
    24-Jun-1998 04:32:28 : XV01086 : Execute failed for SQL statement in
    project Rap
    tServices, class RaptSqlMethods, method updateActivity, methodId 104,
    line 51, e
    rror from database is:
    ORA-01830: date format picture ends before converting entire input
    string
    The Oracle manual says that the above exception occurs when there are
    some extra characters on that field, which is not the case. In fact,
    we raise our own exception for the cases like : o1-Apr-1997,
    01-apr-97 etc. The correct format is 01-apr-1998.
    Same date soemtimes is added to the database successfully. Waht I mean
    to say that the exception deos not occur consistently.
    We just conevert the String taken from the HTML field into a Forte
    DateTimeData Object and send it to database. May be, the conversion
    part is causing the problem. But, once again the problem is not
    consistent.
    Any ideas in this will be appreciated.
    Thanx in advance
    -Rajeev Talwar
    Get Your Private, Free Email at http://www.hotmail.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/>
    Gary Giger
    Raytheon Systems Company
    300 Science Park Road
    State College, PA. 16804
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    This message has successfully passed virus checking.
    Mazda Australia takes every precaution to ensure email messages are virus free. For complete protection, you should virus test this message.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Help with date formatting.

    Hi,
    I have been asked to fix a problem with a report. I have found that the problem is the date format being passed to the stored procedure is not correct, The current format is like Mon April 04 2007. The correct format should be DD-MMM-YYYY which I take to be Mon Apr 04 2004. I am not sure if this is correct anyway, but after looking at the code and the api I have managed to create a date object and call toString on it, after setting a simple date format to dd MMM yyyy.
    The problem is that the toString method returns Mon Apr 02 00:00:00 BST 20
    07. Is anybody able to help me with this? Below is a little bit of the code:
    public void renderDailyReport(ServletWriter out, HttpServletRequest request) throws Exception {
            // reset counters
            totalHits    = 0;
            maxHits      = 0;
            minHits      = 0;
            // get a GregorianCalendar object using the startDate and endDate Strings
            SimpleDateFormat  sdf         = new SimpleDateFormat("dd MMMM yyyy", Locale.UK);
            SimpleDateFormat procedureDateFormat = new SimpleDateFormat("dd MMM yyyy", Locale.UK);
            GregorianCalendar dateCounter = new GregorianCalendar();
            GregorianCalendar upperLimit  = new GregorianCalendar();
            sdf.setCalendar(Calendar.getInstance());
            Date sd = sdf.parse(startDate);
            Date ed = sdf.parse(endDate);
            procStartDate = procedureDateFormat.parse(startDate);
            procEndDate = procedureDateFormat.parse(endDate);The procStart and end dates are the bits that I added.
    They are passed to the stored procedure calling .toString, they are date objects.
    Appreciate any help.

    Do not use the toString() method of Date - it will always be the same format.
    Use the format() method of SimpleDateFormat.
    Date d = new Date();
    SimpleDateFormat sdf = new SimpleDateFormat("'dd-MMM-yyyy"); // or something like this
    String s = sdf.format(d);Message was edited by:
    jbish

  • Data format problem

    Hello All
    Can anyone help me to solve this data format problem? On the top of my program, I have declare the two variables "purchasePrice" and "purchaseAmount" as double. I dont know why, the compiler still think I didnt initialize this two variables? I have printed the error message below the code.
    Thanks for your help : )
    Jen
    =============================================================================
    double purchasePrice, purchaseAmount, GPS, total_gain, amount;
    //Find the purchase stock price
         rs = stmt.executeQuery("SELECT Price FROM PORTFOLIO WHERE Username = '"+ username+"' AND Symbol = '"+strsymbol+"'");
         while (rs.next()){
              purchasePrice = rs.getDouble("Price");
    //Calculate the amount of Gain Per Share
    GPS = intask - purchasePrice;
    //Find the purchase stock amount
    rs = stmt.executeQuery("SELECT Amount FROM PORTFOLIO WHERE Username = '"+ username+"' AND Symbol = '"+strsymbol+"'");
         while (rs.next()){
              purchaseAmount = rs.getDouble("Amount");
    //Calculate the amount of Total Gain
    total_gain = amount - purchaseAmount;
    =============================================================================
    Error message:
    variable purchasePrice might not have been initialized
    [javac] GPS = intask - purchasePrice;
    [javac] ^
    variable purchaseAmount might not have been initialized
    [javac] total_gain = amount - purchaseAmount;
    [javac] ^
    [javac] 2 errors

    Instance and class variables are automatically initialized to their default values if they are not initialized explicitly, but local variables are not. They have to be initialized explicitly before they can be referenced.
    In your code:
        while (rs.next()){
            purchasePrice = rs.getDouble("Price");
        ...purchasePrice is initialized only if rs.next() returns true. purchaseAmount has the same problem. To avoid this problem, you could declare them by:
    double purchasePrice = 0;
    double purchaseAmount = 0;

  • Regarding simple date format

    Hi,
    Can any one please tell what is simple date format for below format.
    2008-11-04T11:49:04.312-04.00

    Basil wrote:
    I think all are getting confused with my question, I dont want to know how to convert date
    to a a particular format, I want to know if there is any format for 2008-11-04T11:49:04.312-04.00
    like yyyy-MM-dd'T'HH:mm:ss.SSS for 2008-11-04T11:49:04.312. My JDK version is 1.4
    Edited by: Basil on Nov 4, 2008 7:43 AM
    Edited by: Basil on Nov 4, 2008 7:43 AMRead the link for SimpleDateFormat and make one. How is that hard to understand? And it is what you have been being told from the beginning, and would have realised had you actually read the API docs pointed to. All the information you need to do so is there.

  • Simple Date Format

    Hi,
    I have an entity object with some attributes, one of them is called "CREATED_ON", which i have specified as a history column (created on).
    I have specified a format type of Simple Date in my Control hint and a format of dd-MM-yyyy. I then created a view based on my entity and dragged the view as an adf creation form. I also dragged a commit button to commit my record.
    However, the date that is stored in my database have a non-zero time component (e.g. 10-JUL-2007 10:46:22). This is a problem becuase in my search form, the search criteria does not work (it requires the exact time also to work). I do not want to use TRUNC in my SQL query.
    Instead i want the date to be stored with the format mask that i have specified.
    Can you please help me?
    Thank you

    Do you really want to lose the time component altogether, or just make the query on date-without-time work?
    There would be no way of recovering the information about when during the day the row was created if you truncate the time information, but it's possible to achieve if that's what you want. Both are possible to achieve.
    To achieve the "losing the current time info forever" approach, add the following overridden method in your entity impl class that slightly changes the way the history attribute value is returned, in my case, for the HIREDATE attribute of an Emp example:
        protected Object getHistoryContextForAttribute(AttributeDefImpl attributeDefImpl) {
            Object ret = super.getHistoryContextForAttribute(attributeDefImpl);
            if (attributeDefImpl.getIndex() == HIREDATE) {
                ret = new Date(new java.sql.Date(((Date)ret).getValue().getTime()));
            return ret;
        }To achieve # 2 instead, just add a SQL-derived attribute to the view object with formula:
    TRUNC(HIREDATE)and then use that sql-derived attribute in the query form instead of the normal HIREDATE attribute.

  • XML Publisher to Excel Report : Date format problem

    Hi,
    I am trying to create an Excel report with XML Publisher. I have an issue with the Date Fomatting.
    In the XML template, I have set the "Date" column in date format. But the excel output report "Date" column returns as "General text" (string) and it is sorted as text, not as date.
    Can anyone please help me out?
    Thanks!!!

    Hi,
    Did this post solve your problem? I have the same issue that I need to solve.
    I have an xsl-fo template with dates in it.
    The dates are in english.
    My excel is setup to use danish.
    When I export to excel it knows the month jan, feb, mar, apr, ... which are the same in danish and english.
    But months where it differs like may (danish maj) the cell is a general text instead of date.
    Is there anyway you can set/transform the date in the xsl-fo template so it does not care about the language in excel?
    Thank you in advance.
    BR Kenneth

  • Quicken 2007 date format problem in Mavericks

    Objective: Get date format in dd/mm/yyyy format in Quicken 2007 (Lion compatible version).
    Current OS: Mavericks 10.9.4
    Hardware: Retina MacBook Pro & iMac 27" 3.2Ghz
    Problem:
    On my rMBP with Mavericks 10.9.4, I’m able to get Quicken 2007 data in dd/mm/yyyy format, as desired.
    On my new iMac (late 2013) with 10.9.4, Quicken recognises the System date formats dd/mm/yyyy (setting up a new register shows System date format) but the registers and data are all in m/d/yy.
    Quicken prefs are set to Canadian, so date formats should automatically be in dd/mm/yyyy, but aren't.
    The Quicken data file is identical on both Macs. The original file goes back to 1991, and has been through all Mac OS iterations since then.
    Pre-Lion, I remember that the workaround was to set the Language & Region to something (English / US, don’t remember which) and then change date formats. Anyway, the dd/mm/yyyy stuck, through Lion and Mavericks on my rMBP, but is causing a problem in the iMac.
    My guess is that Quicken is unable to / blocked out from accessing System date formats in Mavericks 10.9.4.
    Wondering if there’s some way to make Quicken access the Mavericks System date format, and stick to it?
    Possible approach: If some expert in these forums knows how Mavericks works under the hood, how it allows other apps access to System Prefs like date formats etc., perhaps a script or Terminal command could force Quicken 2007 to recognise and accept date formats from System Prefs (Language & Regional settings).
    I'd really appreciate the help; needless to say, the Quicken data is vital to my work.

    Hi Marlon,
    The OS Local definitions. Different countries have different date formats for their location. Check the date format of the OS CultureInfo settings.
    Regards,
    Vítor Vieira

  • Date Format Problem in Custom Report

    Dear all ,
    I am generating SQL statement for the report , i am passing (param_date from ) and (param_date to) to get data from SITs , and there is tow segments in the SITs : (SIT_date from ) and (SIT_date to) also ,, getting the data from the SITs by comparing the dates for the SIT and the parameters ,,, i am facing problem in the date format , ,, could any one please help me what is the format that i can compare the between dates in the SIT and the Parameters ???
    Best Regards
    Edited by: user6781803 on Jan 3, 2010 7:28 AM

    >
    ... i am facing problem in the date format ...
    >
    What is the problem ? Pl also post full versions of your OS and EBS.
    HTH
    Srini

  • Create unique Form ID - Help on Date Format in Concat

    I am having problems formating a date value in my concat statement.  I have tried to write is different ways and still can't seem to get the string correct.
    Ideally, I would like to change the date value to a Julian value for the form ID, but I would settle for just mmddyy value without the / or - in between.
    Codes I have tried w/out date format string
    JavaScript - Calculate
    Program.FormID.rawValue=Program.State.rawValue + Program.ProgramNumber.rawValue + Program.ProgramDate.formattedValue;
    Returns - MO1234Jul8,2010  
    -------------And--------------------
    Program.FormID.rawValue=Program.State.rawValue + Program.ProgramNumber.rawValue + Program.ProgramDate.rawValue;
    Returns - MO12342010-07-08
    FormCalc - Calculate 
    (This one has the current date as a value, but it changes the unique form ID when reopened on another day, that is why I am using ProgramDate)
    Concat(Date2Num(Date(), "ddmmyyy"),Program.State.rawValue, Program.ProgramNumber.rawValue)
    Returns - 0MO1234
    ----------- And --------------------
    if 
    (Program.ProgramNumber.rawValue ne null) then
    $.rawValue
    = CONCAT(Program.State.rawValue, Program.ProgramNumber.rawValue, Program.ProgramDate.formattedValue)
    else
    $.rawValue = ""
    endif 
    Returns - MO1234July8,2010  (formattedValue)
                  MO12342010-07-08 (rawValue)
    What would be the better  language to use, FormCalc or JavaScript for this example?
    I am not all that skilled at coding and use forums like this to help me, so I appreciate any help.
    Thanks in advance - Eve

    Date.prototype.yyyymmdd = function() {
       var yyyy = this.getFullYear().toString();
       var mm = (this.getMonth()+1).toString(); // getMonth() is zero-based
       var dd  = this.getDate().toString();
       return yyyy + (mm[1]?mm:"0"+mm[0]) + (dd[1]?dd:"0"+dd[0]); // padding
    Now, after having spliced the internal Date object, you can do this:
    d = new Date();
    d.yyyymmdd();
    The line above returns today's date: "20100709".

  • Need help with date format mask

    Hi there, right now I'm trying to set a default date format mask constraint for one of the attributes for my table. I want to set the default mask constraint as MM/DD/YY but I don't know how to. it should be something like:
    CREATE TABLE work (WorkDate DATE CHECK (WorkDate = 'MM/DD/YY'))
    or something like that, but I don't think that's correct. Can anyone help me? Thanks in advance.

    What you want (and should have done) is to read the documentation, starting with the concepts:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#CNCPT413
    http://www.oracle.com/pls/db102/search?remark=quick_search&word=date&tab_id=&format=ranked
    A date is stored as, well, a date, format masks only come into play when you're selecting/retrieving a date or when you want to store a string as a date. Default date formats can be set through NLS_DATE_FORMAT at session and database level.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams122.htm#REFRN10119
    Documentation homes (from which you can do a simple quick search):
    http://www.oracle.com/pls/db102/homepage
    http://www.oracle.com/pls/db112/homepage
    Bottom line:
    Trying to set a default date format mask on a date datatype column makes no sense...

  • CLIENT_OLE2 date formatting problem while reading from Excel

    I have installed webutil package and tested that everything works by running webutil_demo as well as WU_TEST_106 form. Then I had implemented reading from Excel sp. sheet using Oracle note 813535.1 (This note has OLE2 code sample on how to read an Excel file). Everything fine till now. The problem started when I have a date fiield to read from Excel. The field where the value is going to has format mask of 'DD-MM-RRRR'. When the date is displayed in the form, it shows '01-AUG-0009' instead of '01-AUG-2009'. I tried changing the date format to different formats in Excel but no go. I found one blog which stated that treat the date as number and use e.g. "cell_date_value:=to_date('01/01/1900','DD/MM/YYYY')+client_OLE2.get_num_property(cel,,'Value')+2" but it too did not change the display. Then I tried debugging and stepping through the code..the only thing I noticed that OLE2 function displayed the date with 2 digit year as 09 and when the code completed execution, the date went back to '01-AUG-0009'. Casting with 4 digit year at every step in the code is not helping to change final date display correctly. Any idea?!!!

    Hi,
    While reading the date column from excel, try using
         m_col_val := OLE2.get_char_property(Workcell,'Text');
    Instead of
         m_col_val := OLE2.get_char_property(Workcell,'Value');
    I think you problem will be solved...
    hello...i meant client_OLE2
    Regards
    Dora
    Edited by: Dora on Sep 16, 2009 11:05 AM

  • CUF and date format problem

    Hi experts!
    I ve created a CUF with "DATS" format on CI_BBP_ITEM structure.
    My problem is that CUF is displaying in ITS with YYYYMMDD format.
    How can I get an  ITS display depending of user date format attributes?
    (ex : DD.MM.YYYY)
    Thanks a lot for your help.
    P.

    Hi Pierre,
    For the CUF field create a new domain in SE11 and set the conversion routine for that domain. Choose a conversion routine that converts it depending on the user date format attribute.
    Then create the cuf field from this domain and add it to the CI_BBP_ITEM structure.
    Or you can go to the transaction SU3 for that particular user. Go to Defaults Tab and change the date format to DD.MM.YY. Save the changes. Try to login again and check the web whether the date is diaplayed in DD.MM.YY format.
    Hope this helps.
    Thanks,
    Pradeep.

  • Helps on date format

    Hi all,
    I got the column in table A where the date format is dd/mm/yyyy ( 01/03/2005), and another table B where the date format is dd/mm/yyyy HH24:MI:SS. So in order to let the two table to talk to each other, I hv the following query
    B.transaction_date >= TO_DATE(A.start_date , 'DD-MON-RRRR HH24:MI:SS')
    B.transaction_date <= TO_DATE(A.end_date, 'DD-MON-RRRR HH24:MI:SS')
    I hv problem with the end result b'cos of the date format in table A is dd/mm/yyyy whereas the transaction_date in table B has the format with time. How can I format or convert the date in the table B to be in defaulted time such as A.start_date 00:00:00 and b.end_date 23:59:59 ??
    How to format this ? please helps. Thanks
    Rgds
    Lim

    Hello
    Are the transaction_date, start_date and end_date columns all DATE data types?
    If so, all DATE columns have the time component but it may be truncated i.e. set to 00:00:00. To do a date range in your case you could do something like:
         B.transaction_date >= A.start_date
    AND
         B.transaction_date < A.end_date + 1By using this construct you are forming a range between today at midnight and tonight at 23:59:59, so you don't have to worry about setting the time component on your end_date.
    HTH

Maybe you are looking for

  • I forgot my old password and now i cant get a new one because it says the old one is wrong

    So I used to have a password on my computer for when my mac first turned on and all that but, I gat tired of having to put my password in every single time i turned my mac, on so i took it down. Now, every time I want to download something it asks fo

  • Final settlemnt of project to main asset  by using t.codeCJ88

    Dear Gurus, When my user is trying to do the final settlement of Project to Main Asset by using t.code CJ88. it is giving error Net book value is in negative area 01. Here the details is there is one project system that he wants settle to Main asset

  • Multiple events triggered in BUS1001006

    Hey Workflow guru's, I have a scenario where once the basic views are created for a material in MM01, two work-items are sent to create the Classification and Sales views for that material. I have delegated a Z business object from BUS1001006 and usi

  • How to pass variable in module screen

    dear sir\madam, how can i pass variabal into the module pool screen field which is not a part of table used in screen??

  • Writing on pdf

    Until recently under Tools I had the option to write on pdf. Not any more. What can I do to restore to writing?