convert-time token IDM 4.7.3

Hello,

IDM 4.7.3  /dDesigner 4.7.3

I have an issue when using the convert-time token and adding an offset - when I do I get the following error:

 

 

 

User Notifications : Action: do-set-local-variable("timestampTodayLowerLimit",scope="policy",token-convert-time(dest-format="yyyyMMdd000000Z",dest-lang="sv-SE",dest-tz="UTC",offset="14",offset-unit="day",src-format="!CTIME",src-tz="UTC",token-time(format="!CTIME",lang="sv-SE",tz="UTC"))). User Notifications : arg-string(token-convert-time(dest-format="yyyyMMdd000000Z",dest-lang="sv-SE",dest-tz="UTC",offset="14",offset-unit="day",src-format="!CTIME",src-tz="UTC",token-time(format="!CTIME",lang="sv-SE",tz="UTC"))) User Notifications : token-convert-time(dest-format="yyyyMMdd000000Z",dest-lang="sv-SE",dest-tz="UTC",offset="14",offset-unit="day",src-format="!CTIME",src-tz="UTC",token-time(format="!CTIME",lang="sv-SE",tz="UTC")) User Notifications : token-convert-time(dest-format="yyyyMMdd000000Z",dest-lang="sv-SE",dest-tz="UTC",offset="14",offset-unit="day",src-format="!CTIME",src-tz="UTC",token-time(format="!CTIME",lang="sv-SE",tz="UTC")) User Notifications : token-time(format="!CTIME",lang="sv-SE",tz="UTC") User Notifications : Token Value: "1571147925". User Notifications : Arg Value: "1571147925". User Notifications : DirXML Log Event ------------------- Status: Warning Message: Code(-8033) Error in vnd.nds.stream:/system/DriverSet/User Notifications/Subscriber/Leaving Employee notifications:21: Couldn't convert date/time '1571147925': java.text.ParseException: Unparseable date: "20191015000000 0000" User Notifications : Token Value: "20191015000000 0000". User Notifications : Arg Value: "20191015000000 0000".

 

 

 

It doesn't matter if I change timezones or the number in the offset - or the days/weeks etc. However if I remove the offset - it outputs a date-string as it is supposed to do. 

 

Is it only me?

 

br

/Anders

 

  • Verified Answer

    Dear Anders,

    the problem in your case is the Date and Time Pattern used.

    You defined yyyyMMdd000000z as a pattern, but the "0" is not defined as valid character in this pattern.

    Please use only patterns defined in  SimpleDateFormat definition in the JAVA documentation.

    By using the pattern yyyyMMddz you will get your futor or historic timestamp, whatever you define as an offset.

    If you need the 0000 later I suggest to use yyyyMMdd as a pattern only and append the string/text "0000 0000" to the variable!

     

    Kind regards,

     

    Thorsten 

     

  • Awsome  

     

    Funny thing is that in another policy the zeroes works... but then I don't have an offset... 

     

    Anyway - Case closed and thnx!

     

    br

    //Anders