TestProject Forum

Is it possible to get the last day of the current month?

Is there a command that will let me get the value of the last day of the current month (i.e. 2021/08/31) and store that value it in a parameter? If so, does one have an example of how to do so?


This is the only way i can think of. Get the date. Trim the string to get the month. Set a condition to store a defined date based on the month.(january to December)
I want to know if we can we do an OR condition so that the steps will be shorten?

I just had a chance to try the above and it works beautifully, even if it isn’t the most elegant code I’ve ever written :slight_smile:. I also added additional instances for February in my test for upcoming leap years (setting the last date of that month to 29 vs. 28) and set my conditions for those instances to see that the month = 02 AND that the year is a leap year (2024, 2028, 2032).

1 Like