Xp20:current-dateTime() and Milliseconds

Hi
Does anyone know how to obtain a dateTime to 1 tenth of a second?
2007-07-06T09:11:48+00:00 is being returned from the above function and I need the date in the following format
2007-07-06T09:11:48.1Z
Many thanks
Pete

Hi Pete,
Here's a sample BPEL process that fills a xs:string variable called currentDateTime with a formatted date/time string:
<?xml version = "1.0" encoding = "UTF-8" ?>
<!--
  Oracle JDeveloper BPEL Designer
  Created: Fri Jul 06 14:58:24 CEST 2007
  Author:  Bastiaan Schaap, Floris Automatisering
  Purpose: Asynchronous BPEL Process
-->
<process name="BPELProcess1"
         targetNamespace="http://xmlns.oracle.com/BPELProcess1"
         xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
         xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
         xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
         xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
         xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
         xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
         xmlns:client="http://xmlns.oracle.com/BPELProcess1"
         xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
         xmlns:ora="http://schemas.oracle.com/xpath/extension"
         xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
         xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions">
    <!--
        PARTNERLINKS                                                     
        List of services participating in this BPEL process              
    -->
    <partnerLinks>
        <!--
      The 'client' role represents the requester of this service. It is
      used for callback. The location and correlation information associated
      with the client role are automatically set using WS-Addressing.
    -->
        <partnerLink name="client" partnerLinkType="client:BPELProcess1"
                     myRole="BPELProcess1Provider"
                     partnerRole="BPELProcess1Requester"/>
    </partnerLinks>
    <!--
        VARIABLES                                                       
        List of messages and XML documents used within this BPEL process
    -->
    <variables>
        <!-- Reference to the message passed as input during initiation -->
        <!-- Reference to the message that will be sent back to the requester during callback -->
        <variable name="inputVariable"
                  messageType="client:BPELProcess1RequestMessage"/>
        <variable name="outputVariable"
                  messageType="client:BPELProcess1ResponseMessage"/>
        <variable name="currentDateTime" type="xsd:string"/>
    </variables>
    <!--
       ORCHESTRATION LOGIC                                              
       Set of activities coordinating the flow of messages across the   
       services integrated within this business process                 
    -->
    <sequence name="main">
        <!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess1.wsdl) -->
        <receive name="receiveInput" partnerLink="client"
                 portType="client:BPELProcess1" operation="initiate"
                 variable="inputVariable" createInstance="yes"/>
        <!--
          Asynchronous callback to the requester. (Note: the callback location and correlation id is transparently handled using WS-addressing.)
        -->
        <bpelx:exec name="getFormattedCurrentDateTime" language="java"
                    version="1.4">
            <![CDATA[java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat();         
sdf.applyPattern("yyyy-MM-dd'T'HH:mm:ss.S'Z'");         
String formattedDate = sdf.format(new java.util.Date());         
addAuditTrailEntry("Formatted datetime string is: " + formattedDate);        
setVariableData("currentDateTime", formattedDate);]]>
        </bpelx:exec>
        <invoke name="callbackClient" partnerLink="client"
                portType="client:BPELProcess1Callback" operation="onResult"
                inputVariable="outputVariable"/>
    </sequence>
</process>HTH,
Bas

Similar Messages

  • Reg : xp20:current-dateTime() gives error

    Hi,
    When i use xp20:current-dateTime() function in XSLT 1.0 inside OSB ( replace activity ), it works fine when used alone ,but gives following error when used with dn:lookupvalue functio ( custom xpath function)
    BEA-382513: OSB Replace action failed updating variable "body":
    java.lang.NoSuchMethodException: For extension function, could not find method
    oracle.tip.pc.services.functions.Xpath20.current-dateTime([ExpressionContext,] ).
    Checked both static and instance methods.
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    Please let me know any other datetime function which gives current date time in the following format
    2012-05-23T06:00:11+00:00
    or plz let me knoiw the solution to the above error

    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
    <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
    <mapSources>
    <source type="XSD">
    <schema location="../xsd/CrediTransfer.xsd"/>
    <rootElement name="CreditTransferRequest" namespace="http://vodafone.com.mt/Siebel_Order_Creation"/>
    </source>
    </mapSources>
    <mapTargets>
    <target type="XSD">
    <schema location="../xsd/CrediTransfer.xsd"/>
    <rootElement name="CreditTransferResponse" namespace="http://vodafone.com.mt/Siebel_Order_Creation"/>
    </target>
    </mapTargets>
    <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.5.0(build 110418.1550.0174) AT [FRI APR 06 15:04:12 IST 2012]. -->
    ?>
    <xsl:stylesheet version="1.0"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
    xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dvm="http://www.sLabs.com/soa-utilities/osb/soa.utilities.dvm.LookupTable"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:med="http://schemas.oracle.com/mediator/xpath"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:bpmn="http://schemas.oracle.com/bpm/xpath"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
    xmlns:soc="http://vodafone.com.mt/Siebel_Order_Creation"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:con="http://www.bea.com/wli/sb/stages/transform/config"
    xmlns:fn="www.w3.org/2004/07/xpath-functions/"
    exclude-result-prefixes="xsi xsl xsd soc bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref bpmn ora socket ldap con fn">
    <xsl:template match="/">
    <xsl:variable name="ErrorMessage" select="/con:message"/>
    <!--
    <xsl:variable name="ErrorMessageTwo" select="fn:substring(ErrorMessage,1,4)"/>
    -->
    <soc:CreditTransferResponse>
    <soc:return>
    <soc:StandardResponse>
    <soc:success>
    <xsl:value-of select="dvm:lookupValue('AbstractionLayer_errorCodes','ErrorCode','2','Success','DefaultValue')"/>
    </soc:success>
    <soc:returnCode>
    <xsl:value-of select="dvm:lookupValue('AbstractionLayer_errorCodes','ErrorCode','2','returnCode','DefaultValue')"/>
    </soc:returnCode>
    <soc:message>
    <xsl:value-of select="substring($ErrorMessage,1,4)"/>
    </soc:message>
    <!--
    <soc:message>
    <xsl:value-of select="dvm:lookupValue('AbstractionLayer_errorCodes','ErrorCode','2','Message','DefaultValue')"/>
    </soc:message>
    -->
    <soc:date>
    <xsl:value-of select="xp20:current-dateTime()"/>
    </soc:date>
    </soc:StandardResponse>
    </soc:return>
    </soc:CreditTransferResponse>
    </xsl:template>
    </xsl:stylesheet>

  • 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                                                                                                                                                                                                               

  • Xp20:current-dateTime dose not return actual time in daylight saving

    Hi,
    I have observed that xp20:current-dateTime dose not return the actual time in daylight saving. e.g. when the system time is 14:43:00 the xp20:current-dateTime function returns 15:43:00 i.e. additional 1 hour. Is this a known issue? How to prevent this from happening?
    Thanks in advance.

    Hello,
    I've the same problem. This occurs in BPEL middle tier instalation
    ( Linux x86 timezone set to Europe/Prague)
    and also in JDeveloper > Test xsl form. ( Localised Win XP SP2)
    BPEL version is 10.1.2.0.0.
    In our country we have now CEST ( Central European Summer Time) = GMT +2:00.
    xp20:current-dateTime returns for example 2006-06-27T13:10:15+01:00
    The time 13:10:15 is correct time in our timezone, but timezone +01:00 is not correct.
    Timezone should be +02:00. (?)
    When I insert this dateTime into database table, I have incorrect value there.
    Is there any way to solve this problem? ( any settings ...?)
    Regards
    Karel

  • Xp20:current-dateTime give time of GMT, not of our timezone

    Hi,
    process call xp20:current-dateTime(), this function give time of GMT, not of our timezone(China, GMT+8).
    for example, I call it at 10:20AM, but it return 2:20AM.
    I have edit opmn.xml, at oc4j_soa instance, add "-Duser.timezone=GMT+8" in java-options, restart soa suite.
    but not take effect.
    the server is SOA Suite 10.1.3.3 on Windows 2003.
    any suggestion is welcome.Thanks

    Thats great but what is the timezone of your server where soa suite is installed. Also what is the timezone of the dehydration store server?
    cheers
    James

  • Xp20:format-dateTime with milli seconds always as zeroes

    Hi All,
    I am trying to use the xPath function format-datetime , but in the output factional seconds is returning all zeroes. My picture string looks like below.
    *xp20:format-dateTime(xp20:current-dateTime(),"[H01][m01][s01][f001]*
    Result always in zeroes see example below:
    *105017000*
    Do somebody have some advice on this issue?

    Use ora:getCurrentDateTime() extension function instead... It accepts java SimpleDateFormat patterns and it is able to go milliseconds...
    Cheers,
    Vlad

  • Xp20:format-dateTime method in BPEL 11g

    I am doing a date conversion as xp20:format-dateTime('2007-10-07','YYYYMMDD') and storing in a String variable - givenDateConverted
    but the result is as below
    <givenDateConverted >YYYYMMDD</givenDateConverted>
    My original requirement is to compare this givenDateConverted with the currentDate and reject if givenDateConverted is less than currentDate
    Please help
    Thanks
    Sesha

    Hi sesha,
    Your date 08-OCT-2009 is not in the expected xs:DateTime format like 2002-05-30T09:30:10Z
    This is what xp20:format-dateTime needs.
    What is the date format of the date you need to compare to the current date?
    If it is in the standard xsd:dateTime format you don't need to format anything.
    If it is a comparable format you can format the current time in that format.
    For example:
    <before>      
      <xsl:value-of select="xp20:format-dateTime(xp20:current-dateTime(),"[Y0001][M01][D01][H01][m01][s01]") > '20100909111209'"/>
    </before>see http://www.w3.org/TR/xslt20/#function-format-dateTime
    And beware of timezone issues...
    Groeten,
    HJH

  • Xp20:format-dateTime: How to use it

    Hi
    Can you tell me how to use this XPath function?? Give me an example please.
    I tried xp20:format-dateTime(xp20:current-dateTime(),'ddMMyyyy HHmm') but the result is
    "ddMMyyyy HHmm" (yes, the pattern itself!)
    Thanks
    Marcelo Menezes

    I don't know what the problem could be of this.
    xp20:current-dateTime() function returning time 1 hour ahead
    in this threads the guys are having the same problem (only different date function)

  • Current datetime in xslt

    Hi ,
    I want to get the current datetime during my xlst tranform. I used the below codes but can not get it .
    xslt 1.0
    <xsl:stylesheet ...
    xmlns:ex="http://exslt.org/dates-and-times" extension-element-prefixes="ex">
    <xsl:value-of select="ex:date-time()"/> ...
    </xsl:stylesheet>
    error i got: the function date-time() can not be found.
    xlst 2.0
    <xsl:value-of select="current-dateTime()"/>
    error i got : the function current-dateTime() can not be found.
    Does anyone know how i can solve this problem? Any example or suggestion is welcomed.
    Thanks in advance.
    Dennis

    If that piece of xslt has any chance to succeed, you have to do either one of the modification.
    [1] Either you change the version attribute to 2.0. Oracle xslt processor is one of the earliest to get xslt 2.0 support at the time it is still a working draft. I think current-dateTime() xslt 2.0 function should be supported.
    <xsl:stylesheet version="2.0"[2] There are quite a bit of oracle proprietary extensions there. Hence, if you understand the suggestion(s) all along, it should do the task without appealing to the other extensions which may have their own functions to get the current date-time. This is how you should do for a test, keeping the version="1.0" unchanged.
    <xsl:stylesheet version="1.0"
    xmlns:date="http://www.oracle.com/XSL/Transform/java/java.util.Date"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
    xmlns:ns0="http://www.example.org"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    exclude-result-prefixes="xsl xsd ns0 xref xp20 bpws ora ehdr orcl ids hwf date ">
    <xsl:template match="/">
    ...etc
    <TimeStamp><xsl:value-of select="date:toString(date:new())"/></TimeStamp>
    ...etc
    </xsl:template>

  • Xp20:format-datetime usage....

    Hello gurus,
    I am trying to use the xPath function format-datetime to get rid of the timezone from an input element, but in the output factional seconds is returning all zeroes. My picture string looks like below.
    xp20:format-dateTime($CreationDateTime,"[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f000001]")
    eg: Input: 2011-01-07T09:35:03.624992-05:00
    Output: 2011-01-07T09:35:03.000000
    I am using 10.1.3.4 SOA and jdeveloper version.
    Any help is highly appreciated.
    Thanks in advance.
    Fub

    How do I set this though to format the date itself? i.e. I have set this up so far, xpath20:format-dateTime(xpath20:current-dateTime()), but what do I place in the last set of parenthesis that allows me to achieve this?

  • Not able to calculate maximum DateTime and minimum DateTime in DataObject

    Hi,
    I tried using 'Max' and 'Min' function to get the maximum and minimum of a DateTime Field in the data Object but its throws me : BAM-01242:Invalid calculated coloumn.
    Can't we use 'Max' and 'Min' function on DateTime field in Data Object or Report in Calculated type?
    Thanks in Advance.
    Saba

    Hi Anju,
    Try this...
              <xsl:variable name="monthDiff">
                   <xsl:call-template name="monthDifference">
                        <xsl:with-param name="date1" select="/tns:StartDate"/>
                        <xsl:with-param name="date2" select="xp20:current-date()"/>
                   </xsl:call-template>
              </xsl:variable>
         <xsl:template name="monthDifference">
              <xsl:param name="date1"/>
              <xsl:param name="date2"/>
              <xsl:value-of select="(xsd:date($date1) - xsd:date($date2))"/>
         </xsl:template>Cheers,
    Vlad

  • How to get Current Quarter and Fiscal Quarter for a Date - Fiscal Year starts from 1st April

    Hi, 
    I need to calculate current quarter and fiscal quarter in my Sql query.
    I have a column for DateTime Datatype. 
    I need to find out Current Quarter Name like Q12012, Q22012, Q32012, Q42012 and Fiscal Quarter Name as well.
    Now Fiacal Year starts from 1st April, and Current Quarter starts from 1st Jan.
    For Current Quarter of 2012
    Jan-Mar = Q12012
    Apr-Jun = Q22012
    Jul-Sep = Q32012
    Oct-Dec = Q42012
    For Fiscal Quarter of 2012 ( starts from 1st Apr, 2011 )
    Apr2011-Jun2011 = Q12012
    Jul2011-Sep2011 = Q22012
    Oct2011-Dec2011 = Q32012
    Jan2011-Mar2012 = Q42012
    means if its 1st April, 2012,
    its a new Fiacal Year 2013 so Fiacal Quarter Name should be Q12013
    and its Current Quarter Name should be Q22012
    Can you help me to calculate this in a select query for given dates?
    Thanks in advance, 
    Nirav

    This should do it..
    Select
    FORMAT(datepart(quarter,getdate()),'Q#')+FORMAT(getdate(),'yyyy')

  • How to display the current Date and time in xslt version 1

    i am using xslt version 1 .i want to display the current date and time in the output xml using xslt(Jdeveloper) ..i just added the namespace xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
         xmlns:ns1="urn:oracle:integration:b2b:7D30046DC68A4FA689956D8241FA3B99">
    and used thsi function <xsl:value-of select = "xp20:current-date()"/>
    but it does not works for me ..help needed????
    Edited by: user9519185 on Jan 20, 2009 3:04 AM

    Use a formula: =NOW()
    Format the cell for Date and Time, with both the Date part and the Time part displayed. Format the two parts as you wish, using the choices in the Inspector's menus.
    The cell will update each time the table is recalculated.
    (Description is for Numbers '09 (Mac), Numbers for iOS will be similar, but not necessarly identical in details.)
    Regards,
    Barry

  • Problem with getting current date and time using oracle.jbo.domain.Date

    I`d like to get current date and time using oracle.jbo.domain.Date method getCurrentDate(), but it always return current date and 12:00:00. I also need to get the current time.

    I think you should use java.sql.Timestamp domain.
    (And set database type to TIME or DATETIME.)
    Jan

  • Sample XSLT code to Display the Current date and time

    Hi all,
    Please Let me know code to display the system date in my target in xslt mapping.
    I am trying fn:current-datetime() function for the same.but could not get how to use it .Is it  function right  function.If so please send me the examples on the same.
    Thanks and Regards,
    Srini

    hey
    use this date:date-time()
    also have a look at this
    http://www.w3.org/TR/xpath-functions/#func-current-dateTime
    thanx
    ahmad

Maybe you are looking for

  • How to write file to server side?

    hello, Could anyone pls help me... I just want to see an example how can I write to a file that is placed at the server(save place as the applet). p.s. I have been successfully read a file from there... Suppose I have signed the applet (self-signed),

  • IMac + iPod

    Just switched from a PC to a Mac. Have a VERY old iPod for Windows. The first two times I connected it to the iMac, it synced just fine. But now, the iMac won't even recognize it. The fire wire port is fine as the iPod charges. Question: is it not re

  • P&L statment acct ?

    Good morning, Could some kind member help me? Questions are : -     1)   it is possible to manage also the economic accounts (P&L statement acct) as Open Item Management? -     2)  about accounts managed to single Line Item Display as we can not more

  • HTTPService fails to recognize HTTP Errors

    I have a web service which, under certain (appropriate) circumstances, will return with an HTTP status code of 404 and a status description which provides a detailed error message. Invoking this service from a variety of languages (perl, vba, c#, jav

  • ORA12203:TNS: Unable to connect to destination

    I can not use sql downloaded in my laptop. when i am trying to log on using scott/tiger, user/manager, system/manager, everytime it is saying same and i am not entering any in host string field...can anybody help me please...