Search code examples
datastage

I want to convert in datetime format in datastage


I want to get my output file with specific date time format yyyymmddhhmmss all withoiut separation, am using the following code trim(oconv(date(),"D YMD[4,2,2]")," ","A"):"(":Convert(":","_",Oconv(time(),'TI')):") in my master but am obataining >>> yyyy mm dd (hh_mm_ss_pm) Your help will be really appreciated Thx


Solution

  • The trick is to use a certain separation symbol and replace it afterwards as date and time cannot be directly generated without any separation symbol.

    So this should solve your problem:

    Ereplace(oconv(date(),"D:YMD[4,2,2]") : ":" : Oconv(time(),'MTS'), ":", "")