Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor
2713 views

Flex For TimeStamps

Hello.

I wanna share my flexconnector timestamp parse test document. when it comes to time to make flexconnector, various timestamp format was one of the difficulty to overcome.

I gather this tip and idea from many of posting on  Protect724 and manual etc.

thank you

Labels (2)
7 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Flex For TimeStamps

Thanks for posting this Brad

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Flex For TimeStamps

Thanks ​ for the document!

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Flex For TimeStamps

Hi ​, I've got something to ask on a flex parser I've been working today

My Timestamp: 2016-09-06T17:25:57 ----- I need to map this to endTime

Attempt 1:

token[0].name=ET ,     token[0].type=TimeStamp ,     token[0].format=yyyyMMddTHH\:mm\:ss 
event.endTime=ET---------------- Unsuccessful

Attempt 2:

token[0].name=ED , token[0].type=String

token[1].name=ETtoken[1].type=String
All the below were not returning any values – I mean the fields are just empty-no values seen and no errors seen as well - ---------------- Unsuccessful

a. event.deviceReceiptTime=__createOptionalTimeStampFromString(__concatenate(ED," ",ET),"yyyyMMdd HH\:mm\:ss")


b. event.deviceCustomDate1=__createOptionalTimeStampFromString(__concatenate(ED," ",ET),"yyyyMMdd HH\:mm\:ss")


c. event.deviceCustomDate2=__safeToDate(event.deviceCustomString1,"yyyyMMdd HH\:mm\:ss")

Attempt 3: - - ----- Partially OK but unsuccessful while converting to Timestamp

Now, I want to make sure the tokens are converted to string first, so

event.deviceCustomString1=__concatenate(ED," ",ET) – Successfully mapped as "2016-09-06 17:25:57"

However the below doesn’t work again,

event.endTime=__createOptionalTimeStampFromString(event.deviceCustomString1,"yyyyMMdd HH\:mm\:ss")

Please let me know, what am I missing here..

0 Likes
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Re: Flex For TimeStamps

can you please try this one on page 25?

"1.17 Multiple Time Stamp"

event.deviceReceiptTime=__parseMultipleTimeStamp(datetime,"yyyy-MM-dd'T'HH\:mm\:ss.SSSZ","yyyy-MMdd'T'HH\:mm\:ssZ","yyyy-MM-dd'T'HH\:mm\:ss.SSS","yyyy-MM-dd'T'HH\:mm\:ss")

thank you

0 Likes
Highlighted
Valued Contributor.
Valued Contributor.

Re: Flex For TimeStamps

Nice share, thank you Brad

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Flex For TimeStamps

Thank you so much, Brad! This doc is very helpful!

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Flex For TimeStamps

This is a very helpful document. Thanks.

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.