Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Highlighted
abergvall Trusted Contributor.
Trusted Contributor.
97 views

convert-time token IDM 4.7.3

Jump to solution

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

 

Labels (2)
0 Likes
1 Solution

Accepted Solutions
tschloesser Super Contributor.
Super Contributor.

Re: convert-time token IDM 4.7.3

Jump to solution

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 

 

2 Replies
tschloesser Super Contributor.
Super Contributor.

Re: convert-time token IDM 4.7.3

Jump to solution

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 

 

abergvall Trusted Contributor.
Trusted Contributor.

Re: convert-time token IDM 4.7.3

Jump to solution

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

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.