Question
· Jan 16, 2018

How do i get the last date of the every month

Hi I'm new in cache ... How do i get the last date of the every month

Discussion (3)0
Log in or sign up to continue

date in Cache stored in $horolog, which is just number of days from 01/01/1841. So to get the last day of the month you need the date for the first day of next month minus 1.

USER>set y=2018 for m=1:1:12 set d=$zdh(m_"/01/"_y) w !,$zd(d-1, 4)

31/12/2017
31/01/2018
28/02/2018
31/03/2018
30/04/2018
31/05/2018
30/06/2018
31/07/2018
31/08/2018
30/09/2018
31/10/2018
30/11/2018