[gradsusr] Date Issue for the DAY 2021

Miquel Bernis bernisfeina at gmail.com
Tue Dec 22 11:01:21 EST 2020


I'm dealing with the same problem. Using substr() you can split day (d),
month (m), and year (y), and after that this algorithm looks like works for
me. Returns 0 for a Sunday and up to 6 for a Saturday.

arrayDOW.0=0
arrayDOW.1=3
arrayDOW.2=2
arrayDOW.3=5
arrayDOW.4=0
arrayDOW.5=3
arrayDOW.6=5
arrayDOW.7=1
arrayDOW.8=4
arrayDOW.9=6
arrayDOW.10=2
arrayDOW.11=4

if (m<3)
y=y-1
endif

parm=m-1
dofweek = math_mod((y + math_int(y/4) - math_int(y/100) + math_int(y/400) +
arrayDOW.parm + d),7)

Missatge de CW Weather <weatherstu at chorleyweather.com> del dia dt., 22 de
des. 2020 a les 8:07:

> Hello Users,
>
>
> I know this subject has been covered recently with an issue with the date
> for 2021, with the DAY returning '???'. Is there a suitable work around on
> this for both grads and opengrads users? I know there is a work around with
> some of you implementing Zeller's congruence but alas I have no idea how
> to code or where to code it to.
>
>
> Any help on the matter would be greatly apricated.
> --
>
> Kind regards,
>
> *Stuart Markham*
>
> *Founder of CW Weather*
>
> *Website: chorleyweather.com <https://www.chorleyweather.com/>*
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20201222/ddcae390/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6b66f0ed.png
Type: image/png
Size: 11158 bytes
Desc: not available
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20201222/ddcae390/attachment-0001.png>


More information about the gradsusr mailing list