<div dir="ltr">Stuart,<div><br></div><div>After breaking down the month into a numerical value as you did, use that along with the day and current year into a function as such:</div><div><br></div><div>if (month < 3)<br>  month = month + 12<br>  year = year -1<br>endif<br><br>dow = math_mod(day + math_int((13*(month+1))/5) + year + math_int(year/4) - math_int(year/100) + math_int(year/400),7)</div><div><br></div><div>from here, the value 0 is Saturday, 1 is Sunday...6 is Friday<br><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><b>-------</b></div>William (L.B.) LaForce IV<br>Meteorologist</div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 22, 2020 at 11:28 AM CW Weather <<a href="mailto:weatherstu@chorleyweather.com">weatherstu@chorleyweather.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="font-size:10pt;font-family:Tahoma,Arial,Helvetica,sans-serif">
<p><span>Hi Miquel,</span></p>
<p><br></p>
<p><span>Using similar with substring but how would I integrate that with this code. I've tried Ryan's function but it is throwing an error up somewhere and i've yet to find it. Thanks in advance. And thanks to Ryan as well. </span></p>
<p><span>regards,</span></p>
<p><span>Stuart. </span></p>
<p><br></p>
<p>'query time'<br>time = subwrd(result,3)<br>day = subwrd(result,6)<br>datestr = subwrd (result, 3)<br>if (substr (datestr, 3, 1) = 'Z') ; zptr = 3 ; ;else ; zptr = 6 ; endif ;<br>timestr = substr (datestr, 1, 2)<br>date = substr (datestr, zptr+1, 99)<br>dd = substr (date, 1, 2)<br>mmm = substr (date, 3, 3)<br>yyyy = substr (date, 6, 4)</p>
<p>if (mmm = 'JAN') ; mm = 01 ; endif<br>if (mmm = 'FEB') ; mm = 02 ; endif<br>if (mmm = 'MAR') ; mm = 03 ; endif<br>if (mmm = 'APR') ; mm = 04 ; endif<br>if (mmm = 'MAY') ; mm = 05 ; endif<br>if (mmm = 'JUN') ; mm = 06 ; endif<br>if (mmm = 'JUL') ; mm = 07 ; endif<br>if (mmm = 'AUG') ; mm = 08 ; endif<br>if (mmm = 'SEP') ; mm = 09 ; endif<br>if (mmm = 'OCT') ; mm = 10 ; endif<br>if (mmm = 'NOV') ; mm = 11 ; endif<br>if (mmm = 'DEC') ; mm = 12 ; endif</p>
<p>date = day' 'dd'/'mm' 'timestr':00'</p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p>On 22-12-2020 16:01, Miquel Bernis wrote:</p>
<blockquote type="cite" style="padding:0px 0.4em;border-left:2px solid rgb(16,16,255);margin:0px">
<div dir="ltr">
<div>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.</div>
<div> </div>
<div>arrayDOW.0=0<br>arrayDOW.1=3<br>arrayDOW.2=2<br>arrayDOW.3=5 <br>arrayDOW.4=0<br>arrayDOW.5=3<br>arrayDOW.6=5<br>arrayDOW.7=1<br>arrayDOW.8=4<br>arrayDOW.9=6 <br>arrayDOW.10=2<br>arrayDOW.11=4</div>
<div> </div>
if (m<3)<br>y=y-1<br>endif<br><br>parm=m-1<br>dofweek = math_mod((y + math_int(y/4) - math_int(y/100) + math_int(y/400) + arrayDOW.parm + d),7)</div>
<br>
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">Missatge de CW Weather <<a href="mailto:weatherstu@chorleyweather.com" target="_blank">weatherstu@chorleyweather.com</a>> del dia dt., 22 de des. 2020 a les 8:07:</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="font-size:10pt;font-family:Tahoma,Arial,Helvetica,sans-serif">
<p>Hello Users, </p>
<p><br></p>
<p>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 <span>implementing Zeller's congruence but alas I have no idea how to code or where to code it to. </span></p>
<p><br></p>
<p><span>Any help on the matter would be greatly apricated. </span></p>
<div>-- <br>
<p>Kind regards,</p>
<p><strong>Stuart Markham</strong></p>
<p><em><img src="cid:16086542865fe21dce9e5df873675913@chorleyweather.com" width="78" height="51"></em></p>
<p><em>Founder of CW Weather</em></p>
<p><em>Website: <a href="https://www.chorleyweather.com/" rel="noopener noreferrer" target="_blank">chorleyweather.com</a></em></p>
</div>
</div>
_______________________________________________<br> gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noopener noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a></blockquote>
</div>
<br>
<div style="margin:0px;padding:0px;font-family:monospace">_______________________________________________<br> gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noopener noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a></div>
</blockquote>
<p><br></p>
<div>-- <br>
<p>Kind regards,</p>
<p><strong>Stuart Markham</strong></p>
<p><em><img src="cid:1768b851afb6dc6d4101" width="78" height="51"></em></p>
<p><em>Founder of CW Weather</em></p>
<p><em>Website: <a href="https://www.chorleyweather.com/" target="_blank">chorleyweather.com</a></em></p>
</div>
</div>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote></div>