Highlighted
Regular Contributor.
Regular Contributor.
369 views

Parsing String date and time as a Date in HP Asset Manager

Hi All,

I am trying to parse a string as a date and time field,but the format is not working properly. I am using the below logic to parse the string as a date.

 

lErr1    = amSetFieldDateValue(hRecord1,"LastJobRunDate",ParseDate(ExtractValue(JobRunTimeDateTemp," "), "yyyy-MM-dd'T'HH:mm:ss.S"))

 

Can any body tell me how to parse the string as a date and time IN hpam.

0 Likes
1 Reply
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

ParseDate() as defined in the programmer's reference guide does not show time capability.  Have you tried LocalToBasicTimeStamp()?  Also, the use of ExtractValue() seems to pre-parse just the date portion instead of the entire date-time value so not sure why this is being used when you are explicitly trying to format for time portion.  Have you tried FormatDate()?

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.