Date format  : mm/dd/yyyy HH12:MI:SS

Hi,
Wheteher the output of the 'mm/dd/yyyy HH12:MI:SS AM' only gives AM?
Can we have PM in the date format like 'mm/dd/yyyy HH12:MI:SS PM'?
When will we get the PM in the output while using the date format 'HH12:MI:SS'?

Whenever you are in PM:
sys@sid1> l
1* select to_char(sysdate, 'MM/DD/YYYY HH12:MI:SS AM') from dual
sys@sid1> /
TO_CHAR(SYSDATE,'MM/DD
07/09/2007 01:22:48 PM
1 row selected.
My time is 1:22:48 PM here. Even though I put AM in the to_char format, it noticed it was PM and changed it.

Similar Messages

  • How to convert the date format 'm/d/yyyy hh:mi:ss AM' to 'MM/DD/YYYY HH:M'

    How can i convert a the date format 'm/d/yyyy hh:mi:ss AM' to 'MM/DD/YYYY HH:MI:SS AM' in Oracle
    I have a query
    select UPPER(t.val_10) "TYPE", count(val_3) "Number of Transfers"
    from table1 t
    where t.is_active = 1
    and t.val_4 = 'INBOUND'
    and to_date(to_date(val_5,'MM/DD/YYYY HH:MI:SS AM'), 'DD/MM/YY') between to_date(to_date('01/08/2008 00:00:00','DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YY') and add_months(to_date(to_date('01/08/2008 00:00:00','DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YY'),1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)
    I get the error [ORA-01861: literal does not match format string which i think is because
    val_5 has the values in the following format:
    8/29/2008 6:31:10 PM
    Does anyone have an answer?
    Thanks in advance
    Edited by: user2360027 on 26-Mar-2009 03:50                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    first off, you've got to_date(to_date(...)) - NEVER do this - you're forcing an implicit to_char which can cause all sorts of problems!
    What is the data type of your column val_5? If it's DATE then your query is simply:
    select UPPER(t.val_10) "TYPE",
           count(val_3) "Number of Transfers"
    from   table1 t
    where  t.is_active = 1
    and    t.val_4 = 'INBOUND'
    and    val_5 between to_date('01/08/2008','DD/MM/YYYY') and add_months(to_date('01/08/2008','DD/MM/YYYY') ,1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)If it's a varchar2 (why, oh why, oh why, ...?!), then your query should be:
    select UPPER(t.val_10) "TYPE",
           count(val_3) "Number of Transfers"
    from   table1 t
    where  t.is_active = 1
    and    t.val_4 = 'INBOUND'
    and    to_date(val_5, 'mm/dd/yyyy hh:mi:ss AM') between to_date('01/08/2008','DD/MM/YYYY') and add_months(to_date('01/08/2008','DD/MM/YYYY') ,1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)Remember that dates in DATE format are stored in an internal Oracle format - in order for you to tell Oracle that your string is a date, you need to use to_date. When you want to retrieve a date, you need to use to_char to put it into the format you want to see it in.
    Remember also that your nls_date_format defines the default format that you'll see a date, which is what is used in the implicit conversion that oracle does when you select a date:
    SQL> alter session set nls_date_format='dd/mm/yyyy hh24:mi:ss';
    Session altered.
    SQL> select sysdate from dual;
    SYSDATE
    26/03/2009 11:01:53
    1 row selected.
    SQL> alter session set nls_date_format='mm/dd/yy hh12:mi:ss AM';
    Session altered.
    SQL> select sysdate from dual;
    SYSDATE
    03/26/09 11:02:24 AM
    1 row selected.It doesn't make sense to convert something that's already in a DATE format into a DATE format - in order to do that, oracle has to first change the date into a string, and it does that by using the nls_date_format parameter setting - if you're working with dates-in-strings that are in a different format, then all sorts of problems arise, as you have found out!

  • Problem with  date format "dd-MM-yyyy"

    hi all,
    i am using jdev 10.1.3.2
    My application ADF Swing app.
    in my database i have a table employee which contains "birthday".
    my problem is that i must use date format"dd-MM-yyyy".
    i added this format into "formatinfo.xml" file.
    than i choose it in my EO.
    i create a form which contains employees.
    for example i have an employee with a birthday=25-10-1970
    in my text field if user puts "1970-10-25"'which is not the best format) he will have a correct result "25-10-1970"
    but if user puts "25-10-1970" he will have as result "21-02-0031" which is not the real value.
    please help me.
    thanks.
    PS: i did some research before posting but i didn't find yet

    Rouz,
    Did you try what i said before?
    * Open you EntityObject
    * Expand the attribute tree
    * Choose your DOB attribute
    * Choose the Control hints pane on the right
    * Choose Formater: Simple date format
    * Choose Format mask dd-MM-yyyy
    Run your application and try it.
    This is how i change the format and it works perfectly.
    I uses the correct format to show the date and it enables me to edit the date using the format mask dd-MM-yyyy
    Edit: I just tried it myself. I can only reproduce it by removing my mask. Ergo, the application expects the default american format yyyy-MM-dd. By entering a date in the format dd-MM-yyyy the framework will convert it to yyyy-MM-dd and you'll end up with 0031-02-21.
    CONCLUSION follow the steps i discribed above to set your mask and you'll be fine.
    Message was edited by:
    Smolders Johan

  • How can i change the date format mm/dd/yyyy to dd/mm/yyyy

    How can i change the date format mm/dd/yyyy to dd/mm/yyyy

    Date, time and currency formats are controlled via Settings > General > International > Region Format - you can't just change the date format

  • 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...

  • Need regular expression for oracle date format 'DD-MON-YYYY'

    Hi,
    Can anybody tell me the regular expression to validate date in 'DD-MON-YYYY'.
    My concept is i have a table with just two columns item_name and item_date
    Both fields are varchar2 and i want to fetch those records from this table which have valid date format('DD-MON-YYYY').

    If it must be a regexp, this is a starter for you, note it carries the caveats mentioned by both posters above and in the linked thread
    mkr02@ORA11GMK> with data as (select '10-jan-2012' dt from dual
      2  union all select '10-111-2012' from dual
      3  union all select 'mm-jan-2012' from dual
      4  union all select '10-jan-12' from dual)
      5  select
      6  dt,
      7  case when regexp_like(dt,'[[:digit:]]{2}-[[:alpha:]]{3}-[[:digit:]]{4}','i') then 1 else 0 end chk
      8  from data
      9  /
    DT                 CHK
    10-jan-2012          1
    10-111-2012          0
    mm-jan-2012          0
    10-jan-12            0It will not validate content, only string format.
    And to emphasis the points made in the linked thread - dates in text columns is poor design. Always.

  • Problem with date format dd/mm/yyyy. But I need to convert yyyy-mm-dd.

    Dear friends,
    I have the problem with date format. I receiving the date with the format dd/mm/yyyy. But I can upload to MySQL only in the format of yyyy-mm-dd.
    how should I handle this situation, for this I've created these code lines.But I have some problem with these line. please help me to solve this problem.
    String pattern = "yyyy-mm-dd";
    SimpleDateFormat format = new SimpleDateFormat(pattern);
    try {
    Date date = format.parse("2006-02-12");
    System.out.println(date);
    } catch (ParseException e) {
    e.printStackTrace();
    System.out.println(format.format(new Date()));
    this out put gives me Tue Apr 03 00:00:00 IST 2007
    But I need the date format in yyyy-mm-dd.
    regards,
    maza
    thanks in advance.

    Thanks Dear BalusC,
    I tried with this,
    rs.getString("DATA_SCAD1")// where the source from .xls files
    String pattern = "yyyy-MM-dd";
    SimpleDateFormat format = new SimpleDateFormat(pattern);
    try {
    Date date = format.parse("DATA_SCAD1");
    System.out.println(date);
    } catch (ParseException e) {
    e.printStackTrace();
    System.out.println(format.format(new Date()));
    this out put gives me Tue Apr 03 00:00:00 IST 2007
    But I want to display the date format in yyyy-mm-dd.
    regards,
    maza

  • URGENT !!!!   Problem with Date format MM/DD/YYYY in oracle database to BW

    Hi
    I am wondering if somebody can help me urgently.
    I have oracle database where date is of the format MM/DD/YYYY and I am loading data into BW. DATE data type
    Date in oracle database: 3/30/2007
    First when I used InfoObject ZDATE (with 0DATE) reference (DATS data type) data load failed saying that
    'Value '30-MAR-0 ' of characteristic 0DATE is not a number with 000008 spaces'
    Then I created ZDATE InfoObject as CHAR Type (Length 10) with PDATE Conversion Routine.
    when I created datasource using DB Connect and checked the contents using 'Display Table Contents' after creating data source the data field distorted as
    AR/-0/30-M
    After data load. when I checked PSA
    The Date records look same as AR/-0/30-M
    In cube the field appeared as  30-MAR-0  (last digit of year disappearing)
    In BEx report also it looks like 'AR/-0/30-M'
    Can somebody help me as quickly as possible.
    What should I do if i want to still use DATS data type for ZDATE?
    should I change date format in database if so to what?
    If I should use CHAR type with PDATE or any other routine can somebody give me the routine to have the date in the report exactly as it appears in database?
    I also tried changing date format in user profile...settings. But still its the same.
    Thanks in advance.

    Hello Snrella,
    You can solve this by converting the date format from oracle to the SAP internal date format  using an ABAP routine in the transfer rules.
    Assuming the oracle data field name is ZODATE then here's the ABAP you can use in the transfer rules. Create an ABAP routine transfer rule from ZODATE to your ZDATE infoobject, and then put this ABAP code there. (this code assumes that the format of the date from oracle is MM/DD/YYYY).
    concatenate tran_structure-/BIC/ZODATE+6(4) tran_structure-/BIC/ZODATE(2) tran_structure-/BIC/ZODATE+3(2) into result.
    Hope this helps.

  • 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.

  • Date format mm/dd/yyyy to mmddyyyy

    Hi All,
    I would like to convert the date fromat from mm/dd/yyyy to mmddyyyy.
    Actually i'm taking into a variable n checking it & concatenating it.
    But I want to know any fm for this.
    I want to know in which format the date is entering my program, if the date is coming in mmddyyyy, then I have no issues, I want to go n display in the same format.
    but if it is coming in the different i want it to b converted. mm/dd/yyyy to mmddyyyy.
    Can any body let me if there is any FM , and also let me know how to check the Date Format.
    Regards
    Rohini devi

    hi,
       WRITE : sy-datum.
       DATA : dat TYPE d.
       dat = sy-datum.
       WRITE :/ dat.
    the above mentioned code will give u output
    o/p=> 22/05/2008 -
    this is the format which u have
             22052008   -
    this is wat u wanted
    so jst assgin the variable which has value in dd/mm/yyy to a variable of type d
    reward points if useful

  • Date format dd-MMM-yyyy

    Hi Friends,
    I would be getting the date format in yyyyMMdd and i have to display it in dd-MMM-yyyy.
    I could not see suck option in 'date trans' function.
    Could some one shed somelight on this.

    Create the Simple UDF and use the below code:
    public String dateFormat(String date, Container container) { // date = yyyyMMdd convert to dd-MMM-yyyy
    if (date.length() > 0 ) {
         String [] month = {"JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"};
         char charArray[] = date.toCharArray();
         StringBuffer targetDate = new StringBuffer();
         targetDate.append(date.substring(6));
         targetDate.append("-");
         targetDate.append(month[Integer.parseInt(date.copyValueOf(charArray,4,2),10) - 1]);
         targetDate.append("-");
         targetDate.append(     date.substring(0,4));
         return targetDate.toString();
    return "";

  • Adobe Forms Date Format DD.MM.YYYY.

    Hi Experts,
    I am new to Adobe Forms(Transaction SFP) . The Client has requirement to display the data in DD.MM.YYYY format.
    I saw that the standard 'Date fields' in ADOBE forms does not have this format.
    Any Ideas.
    Thanks.

    Hi
    Drag and drop the Date/Time Field  from Library pallet into Layout. Right click on it  -> Go to Palletes -> select Object -> go to the Field tab ->
    In Display Pattern you simply specify the date format as   DD.MM.YYYY and the active it and test it.
    Try this once. It will work.
    Thanks
    Sriiiiiiiii(Srikanth)

  • How to set date formate dd/mm/yyyy from portal.

    Dear Experts,
    We are implementing ESS/MSS, my query is under ESS applications, date format is showing mm/dd/yyyy, then iam trying to change  user language is English (United Kingdom), from portal end, then its showing dd/mm/yyyy.
    My query is that is there any other way to change date format and how to set user language is English( united Kingdom) for mass users.
    Thanks in advance,
    Regards,
    Mahee.

    Hi,
    Iam trying to upload below format..for mass users....
    [User]
    UID=<employeeid>
    Password=init@123
    FIRST_NAME=xxx
    LAST_NAME=xxx
    group=xxxx
    Language=en_GB
    [User]
    by changing launguage = English (United Kingdom),Now I can able see the require format...dd/mm/yyyy.
    Thanks and Regards,
    Mahee.

  • Problem in date formatting DD-MMM-YYYY

    Hi,
    I am writing a method in my Application:
    //@@begin FormatDate()
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd");
         Date d;
         String OutDate = "";
         try {
              d = dateFormat.parse(InDate);
              dateFormat.applyPattern("DD-MMM-YYYY");
              OutDate = dateFormat.format(d);
         } catch (ParseException e) {
              wdComponentAPI.getMessageManager().reportWarning("Date Parse Exception");
         return (OutDate);
        //@@end
    The OutDate that I get is in Format DD-MMM-YYYY but MMM is in digits instead of letters i.e. for 2007-07-31 it gives 31-007-2007 instead of 31-Jul-2007.
    Any clues to get proper output??
    I have tried applying format DD-MON-YYYY it too doesn't help.
    Thanks
    Anagha

    Hi ..
    check this link..
    https://help.sap.com/javadocs/NW04/current/wd/com/sap/tc/webdynpro/services/sal/localization/api/IWDResourceHandler.html
    https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/services/sal/localization/api/IWDResourceHandler.html#formatDate(java.util.Date)
    How to calculate next date in Java
    Re: Problem with DATE field
    Hope this will helpful for u..
    Urs GS

  • OWB 10gR1 Convert Date format (mm-dd-yyyy) to (yyyy-mm-dd)

    Hi All,
    In OWB 10gR1, I have flatfiles with Date fields having the format (mm-dd-yyyy). I want to load this data into the Staging table in (yyyy-mm-dd) format. How could I do this conversion in my staging mapping ?
    Using external tables is not an option.
    An detailed answer will be extremely helpful.
    Thanks community.

    Wich is this field's datatype in database? Is it date or char? If you are going to store it as a date datatype, you don't have to worry about the date format.
    Have you tried using the Expression Operator to perform the date string conversion in your mapping? Sorry about this lame drawing, but I think it will help you understand:
    source_table ------------ALL_COLUMNS_EXCEPT_DATE_DATATYPE-------TARGET_TABLE
                 |                                                 |
                 +-------EXPR{TO_DATE(DATE_FIELD, 'DATE_FORMAT')}--+In this example, you'll use an expression operator to convert the date string in the format you want. Map other attributes directly to your target table (or other transformations you need to perform).
    This is the generated script of a dummy plan I've built here:
    OPTIONS ( ERRORS=50, BINDSIZE=50000, ROWS=200, READSIZE=65536)
    LOAD DATA
      CHARACTERSET WE8MSWIN1252
      INFILE '{{LOC_FILE.RootPath}}load.csv'
    INTO TABLE "LOAD_TARGET"
      APPEND
      REENABLE DISABLED_CONSTRAINTS
      FIELDS
        TERMINATED BY ';'
        OPTIONALLY ENCLOSED BY '"'
      "COD" POSITION (1) INTEGER EXTERNAL ,
    "NOME" CHAR ,
    "DATA" CHAR "to_date( :\"DATA\" , 'yyyy-mm-dd')"
      )Regards,
    Marcos

Maybe you are looking for

  • Maximum number of files in a folder ?

    Hello, what is the maximum number of files in a folder OS X can handle ? I used a file recovery software called FileSalvage to save some files of an external 300GB with a corrupted disk directory (unable to repair with the usual repair/recovery progr

  • Lenovo N500 NS74APB and corrupted sound via HDMI

    Hello. I have connected the laptop to TV LCD (Philips PFL7403D/12) with HDMI cable and I noticed corrupted sound. There are noises (crackles) and vanishing sound for seconds. Also when i.e. moving the window between the screens, the crackles occure.

  • WHAT IS WRONG IN THE PACKAGE BODY PLEASE HELP ME... CAN U UNDO THE WRONG

    CREATE OR REPLACE PACKAGE EMP_PROK IS FUNCTION BIBI (EMP NUMBER) RETURN EMPLOYEES%ROWTYPE; PROCEDURE EMP_PROCEDURE ; END EMP_PROK; CREATE OR REPLACE PACKAGE BODY EMP_PROK IS FUNCTION BIBI( EMP NUMBER) RETURN EMPLOYEES%ROWTYPE IS EMPREC EMPLOYEES%ROWT

  • No receivables and payables are updated in Profitcenter accounting

    Dear All, No Account Receivables and payables are getting updated In profit center accounting. In 3KEH we need to maintain only the balance sheet accounts? or P&L a/c's also needs to be maintained? Please advice, Rgds, Kumar.

  • Install Essbase App on SAN (v11.1.2)

    Has anyone installed the entire Essbase application on a Storage Area Network (SAN) drive in Windows environment? If so, what has been your experience? Faster / slower performance? Any risks should the SAN configuration change on the back end? In the