Highlighted
Absent Member.. Absent Member..
Absent Member..
328 views

Getting Date

I want to get the current date, in the format DD-MON-YYYY (02-FEB-2012) and store it in a variable for later use in the script.  Can anyone please help ?

 

Barry

0 Likes
2 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Create a Parameter of Date type.

0 Likes
Highlighted
Absent Member.
Absent Member.

I have always had problems with date parameters in non-standard formats. The additional format does not move with script but has to be manually imported to each Load Generator. To get around this problem I always use lr_save_datetime. To create a paramater called MyDate in the format you want the command is:

 

lr_save_datetime("%d-%b-%Y",DATE_NOW,"MyDate");

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.