|
|
马上注册成为ROSABC会员,随时发帖回复。
您需要 登录 才可以下载或查看,没有账号?会员注册
x
:local date;
:local year;
:local month;
:local day;
:local c;
:local y;
:local m;
:local d;
:local w;
:local week;
:set (date) [/system clock get date];
:set (year) [:pick ($date) 0 4];
:set (month) [:pick ($date) 5 7];
:set (day) [:pick ($date) 8 10];
:if ([:pick ($month) 0 1]=0) do={:set (month) [:pick ($month) 1 2];};
:if (($month)=1) do={:set (month) 13;:set (year) (($year)-1);};
:if (($month)=2) do={:set (month) 14;:set (year) (($year)-1);};
:if ([:pick ($day) 0 1]=0) do={:set (day) [:pick ($day) 1 2];};
:set c [:pick ($year) 0 2];
:set y [:pick ($year) 2 4];
:set m ($month);
:set d ($day);
:set w (($y)+(($y)/4)+(($c)/4)-(2*($c))+((13*(($m)+1))/5)+($d)-1);
:while (($w)<0) do={:set w (($w)+7);};
:while (($w)>=7) do={:set w (($w)-7);};
:set (week) [:toarray "sun,mon,tue,wed,thu,fri,sat"];
:set (week) [:pick ($week) ($w)];
:put ($week);
|
|