Highlighted
Absent Member.. Absent Member..
Absent Member..
509 views

Date increment

how to increment date to one day if the date falls end of the month?
0 Likes
10 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Hi Ugandar,

Can you explain your need in detail to let everyone understand the requirement. Then only anyone can help you instantly.

From the post I understand that you are talking about a logic for date function to be used in VuGen script. Within VuGen you have date function that can be used in Parameters list. For any external manipulation you need to use the protocol specific functions such as web_save_timestamp_param() or web_convert_date_param() etc.

If your requirement is more clear, people here can you help you further.


Thanks,
Raj

Regards,
Raj

Like this Post? Click Kudos! to show appreciation.
Is your issue addressed? Click "ACCEPT AS SOLUTION" against the post which helped you the most.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Thanks, Raj for your response.

Appln date is extracted as '11/14/2010'.
We wanted to add one day to the extracted date and store it in a variable.

Note: If the extracted date falls end of the month.

Please share any date manipulation generic functions or any suggesions regarding to my requirement is appreciated.

Regards,
Ugandar .E
0 Likes
Highlighted
Absent Member.
Absent Member.

You can use the following for tomorrow

lr_save_datetime("%Y-%m-%d", DATE_NOW+(1*ONE_DAY), "TOMORROW");

for today
lr_save_datetime("%Y-%m-%d", DATE_NOW, "TODAY");

add a conditional statement to check whether it is end-of-month or not.....
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Thanks, Chris for your suggessions.

We are looking date format as 'mm/dd/yyyy' after adding one day to the date.

Regards,
Ugandar
0 Likes
Highlighted
Absent Member.
Absent Member.

then u can use

%m/%d/%Y

for mm/dd/yyyy

you can refer the date and time parameter for the same
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

DATENOW will give today's date.

But We want to use our application date + 1.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Ugandar,

You are missing the basic logic here. You have to substitute your application date param in the place of "DATE_NOW" with your application date variable. lr_eval_strig() to substitute. Read the VuGen help manual & the examples to understand how you need to use these functions. You have to empower in learning with the suggestions from what people says here instead of expecting complete solution. You have to expect suggestion & work based on them to become a master. Hope you got my point.

As suggested, use the below one to save the date lr_save_datetime("%m/%d/%Y", lr_eval_string("Your_Variable")+(1*ONE_DAY), "TOMORROW");

-Raj

Regards,
Raj

Like this Post? Click Kudos! to show appreciation.
Is your issue addressed? Click "ACCEPT AS SOLUTION" against the post which helped you the most.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Hi Raj,
I tried as per suggessions, substituted 'CheckInDate' paramter in the place "DATE_NOW" but VuGen throwing error as
type error in argument 2 to `lr_save_datetime'; found `pointer to char' expected `int'

lr_save_string("11/30/2010","CheckInDate");

lr_save_datetime("%m/%d/%Y", lr_eval_string ("{CheckInDate}")+(1*ONE_DAY), "TOMORROW");

lr_output_message(lr_eval_string("{TOMORROW}"));
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Are you getting error at step lr_save_datetime("%m/%d/%Y", lr_eval_string ("{CheckInDate}")+(1*ONE_DAY), "TOMORROW"); ?

Verify how you declared the CheckInDate variable.

-Raj

Regards,
Raj

Like this Post? Click Kudos! to show appreciation.
Is your issue addressed? Click "ACCEPT AS SOLUTION" against the post which helped you the most.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

i am getting the error @ lr_save_date() fn.
'CheckInDate' is a parameter.
I tried declare the variable as
char * AppDate;
AppDate = "11/16/2010";

lr_save_datetime("%m/%d/%Y", lr_eval_string ("AppDate")+(1*ONE_DAY), "TOMORROW");

lr_output_message(lr_eval_string("{TOMORROW}"));

But the Vugen throwing the same error

Any suggessions?

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.