IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
 View Only
  • 1.  Date value to Milliseconds conversion in WTX

    Posted Wed June 17, 2015 03:14 AM

    Originally posted by: Rathika


    How to convert a date value(eg: 2014-03-28) to milliseconds???


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Date value to Milliseconds conversion in WTX

    Posted Wed June 17, 2015 07:30 AM

    Originally posted by: GKearney


    Hi,

    I found the following details from an Internet search.

    Question : How to get the millisecond time from date ?.

    I have the following code.

    Date beginupd = new Date(cursor1.getLong(1));

     

    You could use WTX JAVA API to call the Java code to get the millisecond time from the date.

     


    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 3.  Re: Date value to Milliseconds conversion in WTX

    Posted Wed June 17, 2015 07:38 AM

    Originally posted by: Rathika


    Thanks Gkearney I will try this. But is there any possibility of doing this conversion with functions available in WTX and few formulas???  Please post any suggestions


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 4.  Re: Date value to Milliseconds conversion in WTX

    Posted Wed June 17, 2015 09:01 AM
      |   view attached

    Originally posted by: paul.brett


    An example of the Java technique described by my colleague is enclosed as a Project Interchange.

    Input to map = 2012-06-04

    Output = 1338764400000

    Thank-you.

    Paul.

    Follow me on Twitter


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender

    Attachment(s)

    zip
    DateMillis.zip   5 KB 1 version


  • 5.  Re: Date value to Milliseconds conversion in WTX

    Posted Wed June 17, 2015 07:43 AM

    Originally posted by: GKearney


    Hi,

    There are currently no functions in WTX to get the millisecond time from the date.

    If you wish to raise an enhancement request for WTX you could use the following link.

    https://www.ibm.com/developerworks/rfe/?BRAND_ID=343&PROD_ID=948


    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 6.  Re: Date value to Milliseconds conversion in WTX

    Posted Wed June 17, 2015 09:21 AM
      |   view attached

    Originally posted by: paul.brett


    There is also a way to do this with WTX functions only:

    =DATETONUMBER(CURRENTDATE())*24*60*60 gives us how many seconds from December 31, 1864 to today   (you might have to remove 1 day from this value)

    =TONUMBER(MID(TEXT(CURRENTTIME()),1,2))*60*60 gives us how many seconds in the hours since midnight

    =TONUMBER(MID(TEXT(CURRENTTIME()),4,2))*60 gives us how many seconds in the minutes since the top of the hour

    =TONUMBER(MID(TEXT(CURRENTTIME()),7,2)) gives us the seconds since the start of the current minute

    Add them all up and then multiply by 1000 to get milliseconds since December 31, 1864.

    Thank-you.

    Paul.

    Follow me on Twitter


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange

    Attachment(s)

    zip
    DateMillis-WTX.zip   4 KB 1 version


  • 7.  Re: Date value to Milliseconds conversion in WTX

    Posted Tue April 04, 2017 10:53 AM

    Originally posted by: ManivannanMurugesan


    Hi,

     

    I am using the function, "{CCYY-MM-DD}-{HH24.MM.SS.[6-6]}") to populate milliseconds up to 6 digits but by default i get "000" in the last three digits of milliseconds, can anyone please help us to get this resolved,

     

    sample output - 2017.04.0409.23.47.932000

    I tried using the function in the map rule, also changed the field date type and format in the typetree level, i tried the same in a copybook file and also in a schema file, also the same testing in windows and also in Linux server, i get the same result, i want to get the last three digits of milliseconds. 

     

    Let me know if you need more details.

     

    Thanks,

    Manivannan

     


    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange