Welcome! Log In Create A New Profile

Advanced

date function

Posted by PETER ZHOU 
PETER ZHOU
date function
July 18, 2021 09:28AM
Hi,

I would like some help for the following request using windev functions:
For example,
if the date is 01 May 2021..how to get the exact date after 6 months ?
The correct answer should be 31 Oct 2021.

if the date is 02 May 2021, how to get the exact date after 12 months ?
The correct answer should be 01 May 2022.

Regards,

PETER ZHOU
Argus
Re: date function
July 18, 2021 09:09PM
looks like you want to add N months, then remove 1 day (last day of a period of N month starting at)

If that's the case, it's simple:
dWorkDate is date="20210501"
dWorkDate..Month+=6 //Variable with the number of month
dWorkData..Day--
info(dWorkDate)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: