XPath format-dateTime

Hi,
New in XPath.
xp20:format-dateTime(string(2005-01-04)) <= xp20:format-dateTime(string(2005-01-05))
This should be true, but it evaluation results false.
What I´m doing wrong?
Thanx

You can use this functions as follows:
<client:input>
<xsl:value-of select="xp20:format-dateTime(/client:Sensors_JQProcessRequest/client:input,'[MM] [YYYY] [DD]')"/>
</client:input>
With input as - <input>2005-06-09T15:30:44.369</input>, you will get the output as <client:input>6 2005 9</client:input>
But i dont think you can use this function for comparision, neither we have any xpath function for comparing datetime. You need to either write your own custom xpath function or you can use exec activity, write java code in that or use xp20:day-from-dateTime(), xp20:hours-from-dateTime(), xp20:year-from-dateTime(), xp20:minutes-from-dateTime(), xp20:seconds-from-dateTime() and compare them separately

Similar Messages

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

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

  • 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

  • Format-dateTime usage question

    Have a string input of 2007-10-10T10:10:10 am am attempting to use the format-dateTime XPath function in the XSLT Mapper to format the string uisng the string 'YYYY-MM-DDThh:mm:ss.SSS' - my output is simply the fomat string: 'YYYY-MM-DDThh:mm:ss.SSS'.
    Have looked at several threads on this but cannot find any help - what is going on and how do I use this function?
    Thanks - Casey

    Hopefully by now Casey has figured it out but in case someone else finds this thread...
    The date format used by the format-dateTime BPEL / ESB XPath extension function seems to be the same format string syntax specified in XSLT 2.0 format-date() function which is detailed with examples at: http://www.w3.org/TR/2005/WD-xslt20-20050915/#date-time-examples
    An example appears in this thread:
    Re: xp20:format-dateTime: How to use it

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

  • 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

  • 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

  • Xp20:format-dateTime('060111','[Y01][M01][D01]') returns null...

    As part of my tranformation I need to convert a date string into a datetime type. This operation kept returning null so I decided to hard code the value and the result is still null. Can anyone provide any insight?
    XSL TRANFORMATION:
    <order:OrderHdrAction>
    <xsl:text disable-output-escaping="no">ADD
    </xsl:text>
    </order:OrderHdrAction>
    <order:OrderHdrReqdt>
    <xsl:value-of select="xp20:format-dateTime('060111','[Y01][M01][D01]')"/>
    </order:OrderHdrReqdt>
    <order:OrderHdrPonum>
    <xsl:value-of select="/client:adage_orderentry_qdb_processorProcessRequest/client:flat_order/imp1:instruction/imp1:po_num"/>
    </order:OrderHdrPonum>
    RESULTANT XML:
    <order:OrderHdrAction xmlns:order="http://www.shamrockfoods.com/adage/orderentry">ADD</order:OrderHdrAction>
    <order:OrderHdrReqdt xmlns:order="http://www.shamrockfoods.com/adage/orderentry" />
    <order:OrderHdrPonum xmlns:order="http://www.shamrockfoods.com/adage/orderentry">00001234</order:OrderHdrPonum>

    i think this function is for formatting dates, and not parsing them as you are attempting. Try using substring instead.

  • Transformation: format-dateTime

    Hi,
    I am stuck with transformation. I am trying to map a string column to a date column.
    Column name: imdtsc (String datatype)
    Value: 20080624054923
    For converting this string and for mapping to destination date field, I have used this function:
    <ns2:trxDate>
    <xsl:value-of select='xp20:format-dateTime(/top:F59432001Collection/top:F59432001/top:imdtsc,"[Y0001]-[M01]-[D01] [H01]:[m01]:[s01].0")'/>
    </ns2:trxDate>
    Here trxDate is my destination field of Date datatype.
    After deploying and instance creation I am not able to see any value in the table column trxDate.
    Can anyone help me in this. Am I doing something wrong. Is there any other way?
    Thanks,
    Abhishek...

    Thanks Anne for replying.
    I got the solution for my problem. Thanks to ramana.
    Here is my piece of code for this:
    <ns2:trxDate>
    <xsl:value-of select="concat(substring(/top:F59432001Collection/top:F59432001/top:imdtsc,1.0,4.0),&quot;-&quot;,substring(/top:F59432001Collection/top:F59432001/top:imdtsc,5.0,2.0),&quot;-&quot;,substring(/top:F59432001Collection/top:F59432001/top:imdtsc,7.0,2.0),'T',substring(/top:F59432001Collection/top:F59432001/top:imdtsc,9.0,2.0),&quot;:&quot;,substring(/top:F59432001Collection/top:F59432001/top:imdtsc,11.0,2.0),&quot;:&quot;,substring(/top:F59432001Collection/top:F59432001/top:imdtsc,13.0,2.0))"/>
    </ns2:trxDate>
    Cheers,
    Abhi...

  • HOW TO GENARATE DATE LIKE 12 DEC 2007 USING xp20:format-dateTime(dateTime a

    HOW TO GENARATE DATE LIKE 12 DEC 2007 USING xp20:format-dateTime(dateTime as string, format as string). PLEASE HELP.

    If i look at the w3 org i would say :
    xp20:format-dateTime('yourfield','[D]-[[MN,*-3]-[Y]')
    or just MN will do too.

  • Is there a way in SSRS 2008 to format datetime to half hour?

    Is there a way to format date time in SSRS 2008 to half hour. I am working on a graph and I am sorting by the hour, but i need
    half hour is there a way I can do this?

    Hi Fozzy767,
    To round time to half hour, we need to use custom function in SQL Server Reporting Service(SSRS). A similiar function can be got from the following thread:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/443a22c6-d5fd-44f6-a379-67f3760537fb/round-time-to-quarter-hour?forum=sqlreportingservices
    To understand how to use custom function, please see:
    http://technet.microsoft.com/en-us/library/ms156028.aspx
    Thanks,
    Jinchun Chen

  • Team foundation service doesn't format datetimes locally

    In using Team Foundation Service AKA VisualStudio Online AKA VisualStudio.com, ALL date and date time formats throughout the various portals eg: Backlogs, Queries, Iterations, Task History etc, consistently show in US date time format.
    Considering I'm an Aussie, it would be nice for me and fellow citizens if the site displays Aussie date time format by default eg: dd/MM/yyyy.   We are an Australian company, so this would be a company wide setting.

    You can change the default culture for your profile on the edit my profile page (click your name in the upper right corner)
    And the account (VSO account) wide setting on the admin/settings page which should be here:
    https://[youraccount].visualstudio.com/_admin/_home/settings
    My blog: blog.jessehouwing.nl

  • Format datetime to date

    Hi All,
    I have a dimension with some datetime columns in it.Some are datetime and some are datetime2(7).
    The users will browse the cube from excel. They just want to see the date and not the time.
    Ex: I have a column named WrittenDate in ClaimDimension and it is datetime datatype. It has values like '2010-11-02 00:00:00.0000000'. Here the user want to see only '2010-11-02' when they browse in excel.
    They will see them as  RowLabels or filters.
    How to do this?
    I need to do this for all the dimensions which have datetime columns.

    What if i convert all my datetime columns to date datatype in my views which my cube uses to get data while processing ?
    Will that display '2010-11-02'  instead of '2010-11-02 00:00:00.0000000'.
    I will update my view for this column as convert(varchar(20),WrittenDate, 110) as WrittenDate
    will this eliminate time and only display date in excel while browsing?

  • Incorrect Timestamp dateTime format: expected YYYY-MM-DDTHH:MM:SS.NNNNNNNNN

    When i insert the data XML data using BPEL Process getting the following exception for date-format
    detail>oracle.j2ee.ws.client.jaxws.JRFSOAPFaultException: Client received SOAP Fault from server : Exception Description: Incorrect Timestamp dateTime format: [2010-01-01] (expected [YYYY-MM-DDTHH:MM:SS.NNNNNNNNN])</detail>
    </part>
    I have used the following date format and tried all the cases same above error.
    xp20:format-dateTime(../../DocumentHeader/EffectiveDate,'[Y0001]-[M01]-[D01] [h]:[m01]:[s01]')
    xp20:format-dateTime(../../DocumentHeader/EffectiveDate,'[Y0001]-[M01]-[D01]')
    Any idea how to convert Date to date format given error?

    Hi,
    I'm guessing the problem is not with the format, but with the input date...
    What content is coming in your EffectiveDate tag?
    It should be something like this...
    <EffectiveDate>2012-08-06T12:11:01Z</EffectiveDate>
    If the date format is not in ISO 8601, the XPath function won't work...
    Cheers,
    Vlad

Maybe you are looking for

  • Financial Reporting Export in Power Point and Excel

    Hello Gurus, I am experiencing a problem with the export of FR in .ppt and .doc. Basically when I export in those formats the report shows only the first page unless the rows are from a row template, any idea why this happens? any workaround to sugge

  • Viewing preferences are not saved / remembered "show pages side by side"

    Hello all, I just uploaded a PDF document to Acrobat.com. After it loads i need to click on "" show pages side by side" or "click to view a single page at a time" to get viewed fitted on the screen. Is there an option that the PDF always load "show p

  • How can i step by step peer my mac pro (late2011) to my 3ed Gen.Appe TV? please help me

    please help me its making crazy..i go to system perfeace and and chose display and want to see the Air Play and i can not see it i restart and i done everything possible but can any one tell me step by step what to do please..

  • Error in asset fiscal year change

    Hi, Experts, Here i have an issue regarding asset fiscal year close,  Here system gone live in nov 2006 after that they are not perform period end  and year end activities.  right know they came out to do all period end activities and year end activi

  • Photoshop HUD not working in OSX 10.6.6

    Hi, I've nVidia GeForce 9400 GT which is in the Adobe Photoshop Supported GPU list but the HUD controls are not appearing by Pressing Shift+Option + right click or with any other key combination. Shift + Command + Rlight Click (with Brush Tool select