Cast to DATETIME Function?

Please someone correct me if I'm wrong, but it seems you can use the cast function to convert correctly formatted data to date, timestamp, etc, but it is not possible to cast to datetime?
OBIEE 11.1.1.6.2
Thanks,
Geo

My date is like '30/04/1990 15:30:00' I want to keep the time after the date... which is why I want to convert to datetime. If I convert to date then I lose the time - i.e. the output becomes 30/04/1990 00:00:00. So I thought the solution was to cast to datetime instead in OBIEE.
However, CAST("subjectarea"."table"."columnname" AS DATETIME) throws an error. Hence, I'm wondering if it is not possible to cast to datetime......
Can anyone advise?
Thanks,
George

Similar Messages

  • Xp20:current-dateTime() function returning time 1 hour ahead

    Do anyone know if the xp20:current-dateTime() function is incorrect? It is returning time 1 hour ahead, for example: when executed and put into a database, the column shows 2007-08-28 13:46:54.0, but the ESB flow was executed at about 12:46pm.
    Any help would be greatly appreciated.

    Check the timezone setting on your DB and the App server OS. They must be on different zones.
    --Shiv                                                                                                                                                                                                               

  • Cast and Concat functions error

    Hi
    I am getting below errors while doing cast and concat
    The error message is nQSError: 22020] Function Concat does not support non-text types.
    and my concat code is
    CAST (cast(day(current_date) as char)||'-'||month(current_date)||'-'||cast(year(Core."Dim - Date"."Date") as char) AS DATE )
    Error when tried it differently [nQSError: 27002] Near <)>: Syntax error [nQSError: 26012] .
    CAST (concat(cast(day(current_date) as char)||'-'||month(current_date)||'-'||cast(year(Core."Dim - Date"."Date") as char)) AS DATE )
    Please suggest.

    Hi,
    CASE WHEN Core."Dim - Date"."Year" = 'year(current_date)' THEN FILTER( AGO(Core."Fact - Spend and AP Invoice Distribution"."Spend YTD", Core."Date"."Year", 1)
    USING Core."Dim - Date"."Date" = VALUEOF(NQ_SESSION."R_Current_Date")) WHEN Core."Dim - Date"."Year" <> 'year(current_date)' THEN FILTER( AGO(Core."Fact - Spend
    and AP Invoice Distribution"."Spend YTD", Core."Date"."Year", 1) USING Core."Dim - Date"."Date" = CAST ( TRIM(BOTH ' ' FROM CAST ( EXTRACT( DAY FROM CURRENT_DATE )
    AS CHARACTER ( 30 ))) || '/' || TRIM(BOTH ' ' FROM CAST ( EXTRACT( MONTH FROM CURRENT_DATE ) AS CHARACTER ( 30 ))) || '/' || TRIM(BOTH ' ' FROM
    CAST (Core."Dim - Date"."Year" AS CHARACTER ( 30 ))) AS DATE )) ELSE 0 END
    Here I have taken this part of the code from above code and started testing from answers
    CAST ( TRIM(BOTH ' ' FROM CAST ( EXTRACT( DAY FROM CURRENT_DATE )
    AS CHARACTER ( 30 ))) || '/' || TRIM(BOTH ' ' FROM CAST ( EXTRACT( MONTH FROM CURRENT_DATE ) AS CHARACTER ( 30 ))) || '/' || TRIM(BOTH ' ' FROM
    CAST (Core."Dim - Date"."Year" AS CHARACTER ( 30 ))) AS DATE )) ELSE 0 END
    what I could make out is when I was casting it to date I was getting the error
    ORA-01830: date format picture ends before converting entire input string at OCI call OCIStmtExecute:
    So When I have casted it to char and removed the year function from concatenation it worked out.
    With the same idea I have used this part of the code in my main code above but here char was not working out, so I need to use date and there were no compilation
    errors as it used to be before.
    CASE WHEN Core."Dim - Date"."Year" = 'year(current_date)' THEN FILTER( AGO(Core."Fact - Spend and AP Invoice Distribution"."Spend YTD", Core."Date"."Year", 1)
    USING Core."Dim - Date"."Date" = VALUEOF(NQ_SESSION."R_Current_Date")) WHEN Core."Dim - Date"."Year" <> 'year(current_date)' THEN FILTER( AGO(Core."Fact - Spend
    and AP Invoice Distribution"."Spend YTD", Core."Date"."Year", 1) USING Core."Dim - Date"."Date" = CAST ( TRIM(BOTH ' ' FROM CAST ( EXTRACT( DAY FROM CURRENT_DATE )
    AS CHARACTER ( 30 ))) || '/' || TRIM(BOTH ' ' FROM CAST ( EXTRACT( MONTH FROM CURRENT_DATE ) AS CHARACTER ( 30 ))) || '/' || TRIM(BOTH ' '
    FROM CAST (Core."Dim - Date"."Year" AS CHARACTER ( 30 ))) AS DATE )) ELSE 0 END
    Now when I check results in reports. I get the error ORA-01830: date format picture ends before converting entire input string at OCI call OCIStmtExecute
    The problem here happening is
    Core."Dim - Date"."Date" data type is DATETIME
    and the concat string whole date type is DATE.
    Its like datetime=date
    Since becuase of this mismatch I assume I am getting this error.
    So I thought of changing the data type of Core."Dim - Date"."Date" data type in rpd. Even though I checked out to do the changes I am unable to do though I login with
    Admin account.
    Secondly I thought of changing the concat string whole date type to DATETIME then I get the syntax error.
    Any help on this would be much appreciated.
    Thanks.
    Edited by: 949675 on May 7, 2013 5:33 AM

  • Issue with using year-from-dateTime function

    Hi
    I am novice on XML and related technologies and as luch would have it I need to get a value in YYYY-MM-DD irrespective of input format.
    I am using the Xpath functions year-from-dateTime,month-from-dateTime etc to split up the input value and put the net in the required format.
    When I am trying to use fn:year-from-dateTime to get year from a variable that consists of "29/07/09" as below
    {color:#0000ff}*<xsl:value-of select="fn:year-from-dateTime(xs:date('29/07/09'))">*{color}
    where 'fn' prefix refers to http://www.w3.org/2005/02/xpath-functions
    and 'xs' prefix refers to http://www.w3.org/2001/XMLSchema
    and I am getting below error while running transformation from java...
    {color:#ff0000}*'The first argument to the non-static Java function 'date' is not a valid object reference.'*
    FATAL ERROR: 'Could not compile stylesheet'{color}
    I dont know of any method "date" in java
    Can any body help me on this...I have been breaking my head on this since yesterday..

    "BJWILD" <[email protected]> wrote in
    message
    news:g7dqkq$bqn$[email protected]..
    > Im trying to create a functino that takes an array as a
    parameter and give
    > it a
    > default value of an empty array however im getting 1047:
    Parameter
    > initializer
    > is unknown with a number of ways I have tried.
    >
    > eg:
    >
    > public function foo( myArray:Array = [] ):void{
    > // do stuff with the array
    > }
    >
    > generated this error:
    > 1047: Parameter initializer unknown or is not a
    compile-time constant.
    >
    > using myArray:Array = new Array() gives the same
    error...
    >
    >
    > Anyone else come across this?
    try
    public function foo(myArray:Array=null):void{
    if (myArray==null){
    myArray=new Array();
    not sure why what you tried isn't working, but this is one
    way arround it...

  • TABLE  FUNCTION OR CAST WITH TABLE FUNCTION

    Consider following scenario:
    I've a function which returns nested table of employees.
    I am calling this function in some other procedure and building a query dynamically.
    Sample code looks like
    CREATE OR REPLACE  PROCEDURE TEST_PROC( P_EMP_ID   IN   NUMBER,
                                            O_EMP_LIST OUT  SYS_REFCURSOR) IS
    v_tbl_emp_id       tbl_emp_id;
    begin
    v_tbl_emp_id :=  fn_get_usr_list (P_EMP_ID);--fetches employee id  reporting to given emp id
    v_select_clause :=
             'SELECT EMP_NO,EMP_NAME,DEPT_NO';
    v_from_clause := ' FROM EMP';
    v_where_clause1 :=
                ' WHERE emp_no IN (
                          SELECT  COLUMN_VALUE
                                     FROM TABLE
                                             (CAST
                                                 (:v_tbl_emp_id AS tbl_emp_id
    --AND I AM APPENDING AND CLAUSES BASED ON VARIOUS CONDITION
    v_qry :=     v_select_clause  || v_from_clause|| v_where_clause1;
    OPEN O_EMP_LIST FOR v_qry USING v_tbl_emp_id;
    END TEST_PROC;I CAN REWRITE THE SAME CODE AS
    CREATE OR REPLACE  PROCEDURE TEST_PROC( P_EMP_ID   IN   NUMBER,
                                            O_EMP_LIST OUT  SYS_REFCURSOR) IS
    begin
    v_select_clause :=
             'SELECT EMP_NO,EMP_NAME,DEPT_NO';
    v_from_clause := ' FROM EMP';
    v_where_clause1 :=
                ' WHERE emp_no IN (
                          SELECT  COLUMN_VALUE
                                     FROM TABLE(fn_get_usr_list (:P_EMP_ID)))';
    --AND I AM APPENDING AND CLAUSES BASED ON VARIOUS CONDITION
    v_qry :=     v_select_clause  || v_from_clause|| v_where_clause1;
    OPEN O_EMP_LIST FOR v_qry  USING P_EMP_ID;
    END TEST_PROC;Now I would like to know which one performs better
    USING TABLE ALONE OR USING CAST ALONG WITH THE TABLE FUNCTION?
    AND PLEASE HELP ME ON FORMATTING CODE.
    I've added tags still its not formatting!!
    Thanks,
    NM
    Edited by: user10862473 on Apr 11, 2011 12:14 AM
    Edited by: BluShadow on 11-Apr-2011 09:13
    fixed {noformat}{noformat} tags

    To be sure which is better you will have to test them both. You can use either AUTOTRACE or Oracle trace (tkprof) to get run metrics - system resources used when running both versions of the query. AUTOTRACE won't provide CPU information, but if you can find the qieries in (G)V$SQL you can find it there. Oracle trace is more effort but should provide more metrics. I could do it if I have privileges :(..
    All I can do is check the time taken by the both procedures using set timing on, which gives same result for both.
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.07Thanks,
    NM

  • Format-dateTime function in xsl

    Hi,
    I am trying to convert String format to specific date time format(YYYY-MM-DD HH24:MI:SS:FF).
    I am using below function in xsl:
    <xsl:value-of select='xpath20:format-dateTime(/ns0:Transmission/ns0:TransmissionBody/ns0:GLogXMLElement/ns0:ShipmentStatus/ns0:EventDt/ns0:GLogDate,"[Y0001][M01][D01][H01][m01][s01]")'/>
    But it is not returning any value.
    Source format is String(value= 20101020155400).
    Target is dateTime(Expected Value= 2010-10-20 01:55:40.0).
    Any suggestions will be helpful.
    Thanks

    Hi Arik....
    At last i got it. :)
    Followed the below steps.
    Step1:
    Created a String variable "currentDateTimeValue" in BPEL.
    Step2:
    I have used the below code in JavaEmbedding in BPEL.
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat();
    //Date Pattern looks lil weird. But some Web service accepts only this format.
    sdf.applyPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'-00:00'");//2012-04-14T16:24:00.578-00:00
    String formattedDate = sdf.format(new java.util.Date());
    addAuditTrailEntry("Formatted datetime string is: " + formattedDate);
    setVariableData("currentDateTimeValue", formattedDate);
    Step3:
    Created a Simple XSD with an element "DateElement" of String type.
    Step4:
    Assigned "currentDateTimeValue" value to "DateElement" element, in Assign activity.
    Step5:
    Now added this DateElement in Transformation activity, as a second source variable. Mapped this data to the required target element in my XSL.
    uh-huh I got the output...
    Thanks a ton ARIK :D u r really helpful...
    Regards,
    Sudheer

  • How to get accurate date on current-dateTime function?

    I am new to oracle ESB. Using a DBAdapter, was trying to populate a table row column with sysdate. So, used current-dateTime in xsl mapping. Works well, I can insert time, but this time is always 1 hour greater than current time. Is there something I need to do without substracting 1 hour from it?
    We have the server & the application running in the same time zone.
    Please suggest.

    ESB is always trouble when trying to debug these issues.
    If you go to enterprise manager. When you login you should see a link to oc4j_soa, select this. If not select home.
    Select the Administration tab.
    Select the Logger Configuration link.
    search on esb, make sure it is lower case.
    Find the entry oracle.tip.esb.server.service, make change the logging level to fine.
    This should display the variables being passed in the xml.log file.
    Is the time zone the same as the database?
    Its looking like you might have to raise a SR for this as the application should not be changing the time.
    cheers
    James

  • TABLE FUNCTION call - cast - InvalidType ORA-06550

    hello, I keep getting the following exception: +"... PL/SQL: ORA-00902: invalid datatype ORA-06550: line 7, column 1: ..."+
    I created type here:
    CREATE OR REPLACE PACKAGE types
    AS
    TYPE TmpHiearchyMapTableType IS TABLE OF TMP_HIERARCHYMAP%ROWTYPE INDEX BY BINARY_INTEGER;
    END;
    Then my TABLE FUNCTION resembles...
    CREATE OR REPLACE FUNCTION spGetParentsTable
    ObjectId number,
    ObjectClassifier varchar2
    RETURN types.TmpHiearchyMapTableType
    IS
    TmpHierarchyMap types.TmpHiearchyMapTableType;
    BEGIN
         RETURN TmpHierarchyMap;
    END;
    I tried to invoke the table function and loop through it by:
    DECLARE
    oMappingTable types.TmpHiearchyMapTableType;
    BEGIN
    -- This OKAY!
    oMappingTable := spGetParentsTable(2,'ThinkFundamentals.Util.Security.SystemUser');
    -- FAILED here! "Invalid Type"!?!
    select * from table(cast(oMappingtable as types.TmpHiearchyMapTableType));
    dbms_output.put_line('done!');
    END;
    Thanks!
    REF: http://www.databasejournal.com/features/oracle/article.php/3352091/CASTing-About-For-a-Solution-Using-CAST-and-Table-Functions-in-PLSQL.htm

    hello I managed to switched from "Associate Array" to "Nested table" but still having trouble SELECT * FROM table(...), it keep saying "Invalid DataType" - detail as follows:
    -- NOTE 1: Here's how I create the object type (Be nice if I can just say "CREATE OR REPLACE TYPE TmpHierarchyMapObjType AS OBJECT      (TMP_HIERACHICAL.ROWTYPE)" instead of having to duplicate column definition.
    CREATE OR REPLACE TYPE TmpHierarchyMapObjType AS OBJECT     
    Id numeric(19,0) ,
    ParentId numeric(19,0),
    ChildId numeric(19,0),
    TmpUID varchar2(32),
    ReferencedId numeric(19,0),
    -- NOTE 2: I can't put "TmpHierarchyMapObjType" inside the package but that's not crucial I suppose.
    CREATE OR REPLACE PACKAGE types
    AS
    TYPE cursorType IS REF CURSOR;
    TYPE TmpHiearchyMapTableType IS TABLE OF TmpHierarchyMapObjType; /* Use "Nested Table" instead of Associative Array */
    /* TYPE TmpHiearchyMapTableType IS TABLE OF TMP_HIERARCHYMAP%ROWTYPE INDEX BY BINARY_INTEGER; */
    END;
    -- NOTE 3: Here's my TABLE FUNCTION which now returns a "Nested Table" as supposed to "Associative Array" (with different enumeration syntax)
    CREATE OR REPLACE FUNCTION spGetParentsTable
    ObjectId number,
    ObjectClassifier varchar2
    RETURN ty[es.TmpHiearchyMapTableType -- Now an "Nested Table", not "Associative Array"
    IS
        TmpHierarchyMap types.TmpHiearchyMapTableType;
        ThisTempId varchar2(32);
        CURSOR spGetParents_cursor IS
            SELECT
            ReferencedId Id,
            ParentId,
            ChildId,
            FROM TMP_HIERARCHYMAP
            WHERE TmpUID = ThisTempId;
    BEGIN
        SELECT sys_guid() INTO ThisTempId FROM dual;
        spRecursiveGetParents(ObjectId, ObjectClassifier, ThisTempId);
        -- (Commented out) TmpHierarchyMapMAX := 0;
        FOR oMap in spGetParents_cursor LOOP
            -- (Commented out) TmpHierarchyMapMAX := TmpHierarchyMapMAX + 1;
              _TmpHierarchyMap.Extend();
            TmpHierarchyMap(TmpHierarchyMap.Count) := TmpHierarchyMapObjType( oMap.Id
                                                                    , oMap.ParentId
                                                                    , oMap.ChildId
              NOTE: *(Commented out)*  Not using "Associative Array", now using "Nested table" instead.
            TmpHierarchyMap(TmpHierarchyMapMAX).Id := oMap.Id;
            TmpHierarchyMap(TmpHierarchyMapMAX).ParentId := oMap.ParentId;
            TmpHierarchyMap(TmpHierarchyMapMAX).ChildId := oMap.ChildId;
        END LOOP;
        DELETE FROM TMP_HIERARCHYMAP WHERE TmpUID = ThisTempId;
        RETURN TmpHierarchyMap;
    END spGetParentsTable;
    *-- Lastly, I want to enumerate nested table.*
    DECLARE
    oMappingTable types.TmpHiearchyMapTableType;
    BEGIN
    oMappingTable := spGetParentsTable(2,'ThinkFundamentals.Util.Security.SystemUser');
    *-- NOTE 4: This is my end-goal! But still complaining "ORA-00902: invalid datatype"*
    select * from table(cast(oMappingtable as types.TmpHiearchyMapTableType));
    dbms_output.put_line('done!');
    END;
    *REF:*
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/collections.htm#LNPLS005
    http://www.devshed.com/c/a/Oracle/Associative-Arrays-in-Oracle-PLSQL-Introduction/2/
    http://www.devshed.com/c/a/Oracle/Database-Interaction-with-PLSQL-Nested-Tables/2/                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • SQL: comparing date with datetime field

    I'm having a brain fart as I assume this is really simple.
    Given that I have the date in the format of yyyy/mm/dd, how
    do I put that
    into a sql query that compares that to the datetime field?
    It appears the datetime field, by default, uses this format:
    m/d/yyyy
    hh:mm:ss am
    -Darrel

    If your date formats are different you will have to use CAST
    or CONVERT
    functions as you state you already have. If this works then
    stick with it.
    You may also need to use a SET DATEFORMAT command. See below:
    http://msdn2.microsoft.com/en-us/library/ms189491.aspx
    Dates in SQL Server can be a bit of a pain to work with. It
    is usually best
    practice to store your DateTime data in raw format and use
    CAST or CONVERT
    functions in your Stored Procs to get the correct results.
    Pat.
    "darrel" <[email protected]> wrote in message
    news:ftloim$jv4$[email protected]..
    >
    >> What dbms?
    >
    > t-sql (MSSQL)
    >
    > For now, via string functions, I rearrange the date/time
    format manually,
    > and then use the CAST statement in the SQL query. Not
    pretty, but seems to
    > work.
    >
    > -Darrel
    >

  • SQL Functions Sintax

    LabVIEW 8.5 and Database Connectivity Toolkit and Microsoft Jet 4.0 OLE DB Provider
    I have built the DB structure using the MS ACCESS 2003. One of it´s fileds, I have defined as Short Date, as I had beleived that I was going to get just the date, for instance, 06/07/2007, but instead of this I get the day, 06/07/2007 plus the time, 12:24:34, all together 06/07/2007 12:24:34
    My two questions :
    1) how to store in the date base, just the date, no the time
    2) the SQL Function syntax to display just the date. I thought the correct sintax was : Select SUBSTR(xxx,0,10) from Table. Where xxx is the name of the field in the Table, 0 is the first character of the string xxx and it´s length
    Thanks
    Simbani

    To answer your direct questions:
    1) The "Date/Time" data type is similar to the smalldatetime data type in SQL Server. This stores time information. Can't change this. If you only want to store date information then you need to make your column's datatype to be of character-type. I think "Text" is what Access 2003 uses. Of course, this means you lose anything related to dealing with that column as a date.
    2) If Access 2003 follows the same syntax as SQL Server's T-SQL, the SUBSTR won't work with a column that is a date/time data type. That function would only work with strings. This means you have to first convert the column value to a string. I know that in SQL Server's T-SQL the CAST and CONVERT functions would be used. Have no idea what they would be in Access 2003, so you'll need to check the manual.

  • Pointer to void != pointer to function

    Hello C experts,
    this is a simple question about SunStudio's understanding of function pointers (it might have been asked before):
    Why is the following C code giving me a warning on all Sun compilers:
    # cat funcptr.c
    int main() {
        void (*func)() = (void*)0;
        return 0;
    # cc -c funcptr.c
    "funcptr.c", line 2: warning: assignment type mismatch:
         pointer to function() returning void "=" pointer to voidIs the warning emitted by Sun compiler a bug (over-cautions). Other compiler's don't warn here.
    Of course, I could use 0 or NULL as rvalue but I'm just wondering...
    Jochen

    Thanks everybody for your opinions.
    @Stephen:
    I wasn't aware that data pointers and function pointers may differ in any aspect. In fact, I only know data models that talk about 'pointer' width in general, like LP64 (64-bit wide long- and pointertypes), ILP32 (32-bit wide int-, long- and pointer-types), .. I'm especially surprised to hear that casting between data/function pointers will result in undefined behavior.
    Anyway, to properly 'fix' the code above, I must cast the zero to a function pointer (with matching signature) instead of a void pointer. This compiles w/o a warning:
        void (*func)() = (void (*)())0;Thanks for clarification.
    Jochen

  • Date function in XSLT

    Hi All,
    I am trying to use date function in XSLT, I am using the below code, please correct me if i am wrong
    <corecom:EffectiveDate>
    <xsl:value-of select='xp20:format-dateTime(ns0:Segment-DTM/ns0:Element-373,"[YYYY][M01][D01]")'/>
    </corecom:EffectiveDate>
    Regards
    Francis

    Hi Francis,
    It doesn't seem to be anything wrong with the code itself, but what's the content of ns0:Segment-DTM/ns0:Element-373 ???
    The xp20:format-dateTime function will work if the date on the first parameter is on ISO 8601 format...
    http://www.w3.org/TR/NOTE-datetime
    Examples
    1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time.
    1994-11-05T13:15:30Z corresponds to the same instant.
    Cheers,
    Vlad

  • Add-dayTimeDuration-to-dateTime not working just before format-dateTime

    Hi,
    I am using format-DateTime function just after add-dayTimeDuration-to-dateTime function in XSLT mapping.
    But the response coming doesnot providing the result of add-dayTimeDuration-to-dateTime function.
    When I use both the functions individually then both works fine.
    Please let me know any solution for this.
    Thanks

    Hi Arpit,
    Can you try converting the output of add-dayTimeDuration-to-dateTime to string, before passing it to format-DateTime.
    Also can you post your piece of xslt that you are trying to work out with an example.
    Please do mention what exactly you are trying to do.
    I have tried this and its working fine.
    <xsl:value-of select="xp20:format-dateTime(string(xp20:add-dayTimeDuration-to-dateTime(xp20:current-dateTime(),'PT15S')),'[D01]/[M01]/[Y0001]')"/>
    Please let me know if this helps.
    Thanks,
    Deepak.

  • DateTime with Timezone in XSLT

    All,
    version: 11.1.1.4
    I have a requirement where in I have to validate the datetime in XSLT. User A will send a xml doc with a dateformat he is comfortable. like this many users will send a similar xml doc to my application which can have datetime in any format. But my application wants in a particular format i.e '2013-01-20T05:11:42+05:30'. In XSLT I want to check if the dateformat in the xml doc is in the expected format, send the doc as it is, otherwise format it to the expected date. I'm exploring xp20:format-dateTime function to achieve this.
    to put it in simple algorithm
    if dateformatin xml doc = 'format expected' then
    send as it is
    else
    format it to expected date
    I tried using the xp20:format-dateTime function as <xsl:value-of select="xp20:format-dateTime(/ns0:cXML/Request/InvoiceDetailRequest/InvoiceDetailRequestHeader/@invoiceDate,'[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]')"/> but don't know how to add the timezone to it. Any help is appreciated.
    thanks
    sen

    many users will send a similar xml doc to my application which can have datetime in any formatJust be aware that receiving datetime in any format as you stated is not quite achievable... If you receive 01-12-2013, will be that the 12th of Jan or the 1st of Dec? At the end of the day you will have to decide what format (or formats) you will accept...
    Also xp20:format-dateTime won't help you in this matter, this functions gets a ISO8601 date and formats it... I believe you're trying to do the reverse, and there's no function available in BPEL to do it... Either you'll have to write a custom function or use a java callout with SimpleDateFormat...
    Cheers,
    Vlad

  • How do i get current dateTime in xsl1.0

    Hi,
    I came to know that current-dateTime() function is working fine with xsl version 2.0 but not in xsl version 1.0
    Can anyone suggest me how to get current date time which works fine with xsl version 1.0 and BPEL process manager (OracleApplicationServer 10.1.3).

    Make sure that the History is enabled:
    *Firefox/Tools > Options > Privacy > Firefox will: "Use custom settings for history" > Remember my browsing history
    Make sure that you do not run Firefox in permanent Private Browsing mode.
    *https://support.mozilla.com/kb/Private+Browsing
    To see all History and Cookie settings, choose: Tools > Options > Privacy, choose the setting <b>Firefox will: Use custom settings for history</b>
    *Deselect: [ ] "Always use private browsing mode"
    Another possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    *https://support.mozilla.com/kb/Bookmarks+not+saved#w_places-database-file

Maybe you are looking for

  • How Can i create a trigger

    Hi Every1, I want to create a database trigger which act on entering the charahters and count the characters. e.g you can understand with the example if i press 01 in a specific column the length of characters is two after this automatically the char

  • How do I get iTunes to play all the songs and albums from the same artist?

    Before the update, you used to be able to play all the songs from the same artist across all albums (ie: you have 2 albums from the same artist, you start one, it would play through both in order).  Why did this change, and is there some way to get i

  • Apex 3.1.2 application export

    Hi I have 3 environments, one with apex 3.0 and two with apex 3.1.2. All of them are on 11g DB. When I export an application (about 35pages) from apex 3.0 I get file size approx 1,8MB, but when I export same application from 3.1.2 I am getting the fi

  • Using 'OR' in web services 1.0 query.

    HI, I need to query for a particular contact on the basis of Phone number. Now the search for the Phone Number search should be on 3 fields WorkPhoneNumber, CellPhoneNumber, HomePhoneNumber. contact.setWorkPhoneNumber("='" phoneNumber"'"); contact.se

  • Acrobat Reader X "An Internal Error Has Occurred"

    I have a Windows 7 Professional 64-Bit machine running Acrobat Reader X.  Both the machine and Reader are updated with the latest patches. The primary user on the machine can use the program.  A second (also an administrator) user on the same machine