[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the last saturday in the month

From: gciriani
Subject: Re: the last saturday in the month
Date: Tue, 7 Aug 2018 09:33:42 -0500 (CDT)

There is no need to use datestr, because you admitted you already have the
date number, in your example you gave 733546. 

So if you use d = 733546 then Marco Atzeri's solution is the correct one
which using d as your date variable, in a compact way would become
d = 733546;
a = localtime(d);
b = eomday(a.year+1900,a.mon+1);
Last_Saturday = (a.wday == 6) & (a.mon+7>b)

Giovanni Ciriani - Windows 10, Octave 4.2.1, configured for x86_64-w64-mingw32
Sent from:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]