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

Similar Messages

  • 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

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

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

  • 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

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

  • 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

  • BPC 10 MS Transformation format error using *MVAL with no Rejected items

    I'm a bit perplexed, but maybe I'm being too ambitious.  I am trying to combine a year field from a column in my data file with 12 data columns for each month of that year using *MVAL to pick up those columns.  Basically I want to pull from the file with a result like 2014P1 and then use a Time conversion to make it 2014.OCT.
    I have found that the Mapping statement *Col(1)+*MVAL(25:36) does not work, but reversing it does, i.e. *MVAL(25:36)+*Col(1).  This brings the small problem in the conversion file of making P1* convert for both P1 and P10, so to solve this I added +*Str(.) in the middle of the mapping statement.  This brings results like P1.2014 and P10.2014 to be converted in the conversion file.
    After several attempts the conversion I ended up with is:
    EXTERNAL P1.* : INTERNAL *.OCT
    EXTERNAL P2.* : INTERNAL *.NOV etc etc to P12
    When validating the Transformation file it returns the error:
    Input string was not in a correct format
    Validation with data file failed
    [The conversion file validated and processed with no problems, even with some VB added to reduce the year by 1 in the first three Periods.]
    The strange thing is that the Rejected List is not greyed out, but it is completely empty - usually this error generates some rejected items that you can then learn from and revise your mappings or conversions.
    If I change the conversion to repeat the * after the month, *.OCT*, then I do get rejections that correctly tell me that the conversion does not match my time id's.  I see 2014.OCT2014 in the rejected items.  This confirms that the correct part is being picked up by the conversion *.OCT, but that for some reason it is not accepted.
    Running this for an Import in Data Manager also fails - this is not a bug in the transformation validation routine.
    So, my questions are:
    - am I doing something obviously wrong? or
    - am I being too ambitious with *MVAL? or
    - should this work, so that a dynamic conversion for any year can be set up - in other words is this a bug?
    We are running BPC v10 MS SP12 with EPM SP16.  I attach my Transformation file and the Time conversion.
    Thanks
    Chris

    I was much delayed in testing this due to other issues, but an opportunity came up last week when building a new environment.  This time the column headings were needed for the 12 data columns (12 months Oct to Sep with 3 letters) which meant I could try adding the year as a *Str() function in the mapping before the *MVAL statement.
    The result was that it still failed but with another error:
    Index was outside the bounds of the array.
    I abandoned due to time and built a specific conversion file for the months.  Each time I load some historic data I have to edit this to put in the correct years.  I keep these lists pasted on the right of the formula column for easy reference.
    One odd thing that we still find consistently since SP12 is that the last column header is always missed.  To get around this we often add an extra blank column to the input files or in this case I added P12 to my conversion file so that the data was picked up.  This is inconvenient.
    It would be good to be able to pick up a year from a column in the data or to add it with the *Str() function before the *MVAL statement.
    I have still to try Astha's proposal below.  Next time!
    Thanks
    Chris.

  • Simple transformation formatting

    Dear Expert,
    I would like to know how can I format my transformation result using simple transformation. I have an attribute that is supposed to display a date in the format YYYYMMDD. However, the default format is YYYY-MM-DD. How can I change this behavior in simple transformation? Thanks!
    Regards,
    Alex

    Hey Alex,
    do you have a solution already? I have the same problem, the format of the date in the XML-File is "20140101" and I can´t transform it with Simple Transformation to the ABAP Type DATS which waits for "2014-01-01" or "2014.01.01".
    the Transformation looks like this in the moment:
    <DATE tt:value-ref="DATE"/>
    The ABAP type of the field DATE is DATS. And the XML looks at this part like this:
    <DATE>20131201</DATE>
    Regards,
    Christoph

  • XSLT transformation format-number into strange characters

    Hi, Experts,
        When I excute following code to translate a string number DEBIT TYPE C(60) into xml, the result has strange characters.
    <xsl:value-of select="format-number(sap:if(string(number(DEBIT))!='NaN',DEBIT,0),'0.0000000000')" />
        If DEBIT is empty, the correct result should be:
    0x3000 0x2E00 (0x3000)*10       = 0.0000000000
        but actually, the result will be following in some cases:
    0x3000 0x2E00 (0x0F77)*10
        in some cases the result will be
    0x3000 0x2E00 (0x2600 0x2300 0x3000 0x3B00)*10
        What I mean in some cases, I ran the same code on different NW system. I also changed the user profile by NW menu System->User Profile->Own Data, the result won't change whether I use American Comma-Dot or European Dot-Comma.
        Can anyone give some advice on the code? Or there is some patch to solve it?
        Thanks and Regards
    Davin
    Edited by: Davin Wang on Jul 17, 2008 3:15 PM

    Hi Davin,
    do chk the condition it is not correct
    <xsl:value-of select="format-number(sap:if(string(number(DEBIT))!='NaN',DEBIT,0),'0.0000000000')" />
    do chk it
    Thanx
    Sampath

  • 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

Maybe you are looking for