(WMB) Timestamp Conversion

Often we require to change time stamp from one format to another.
Below esql code shows how to convert an incoming data (which is a time stamp in string) into time stamp or String of the desired format.


Declare srcFormat CHARACTER; -- Source (Incoming time stamp format)
Declare targetFormat CHARACTER; -- Target (Expected time stamp format)
DECLARE InTime TIMESTAMP; 
SET srcFormat = 'yyyy-MM-dd HH:mm:ss.SSS';
SET targetFormat = 'yyyy-MM-dd''T''HH:mm:ss.SSS';


-- Converting string into time stamp of same format.
SET InTime  =  cast(InputBody.time as TIMESTAMP FORMAT srcFormat);


-- Converting time stamp to string of target format.
SET OutputRoot.XMLNSC.out.time = cast(InTime as CHARACTER FORMAT targetFormat); 

14 comments:

  1. ALL the explanation is very nice. Could you post all the nodes use and scenario wise explanation could be very use full.

    ReplyDelete
  2. Thank for providing information..If possible provide latest version (i.e IIB 9.0). It will helpful for all, who is reffering this blog.
    Thanks,
    Prabhakar

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Thank you for giving useful information

    ReplyDelete
  5. Great blog you people have maintained there, I totally appreciate the work.Timestamp Convert

    ReplyDelete
  6. Superlative style of writing that every new blogger aspires to have.
    Decimal Numbers

    ReplyDelete
  7. It’s really amazing that we can record what our visitors do on our site. Thanks for sharing this awesome guide. I’m happy that I came across with your site this article is on point,thanks again and have a great day. Keep update more information..

    Hadoop Training in Chennai

    Java Training in Chennai

    ReplyDelete
  8. Hi,
    Is there anyway to convert the incoming milliseconds into date in esql?
    E.g source is a date in form of milliseconds.

    ReplyDelete
  9. This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.
    best rpa training in bangalore
    rpa training in bangalore
    rpa course in bangalore
    RPA training in bangalore
    rpa training in chennai
    rpa online training

    ReplyDelete
  10. Fantastic work! This is the type of information that should follow collective approximately the web. Embarrassment captivating position Google for not positioning this transmit higher! Enlarge taking place greater than and visit my web situate
    Python Online certification training
    python Training institute in Chennai
    Python training institute in Bangalore

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete