Day of the week: Difference between revisions
Content added Content deleted
(php) |
(→{{header|UNIX Shell}}: max date now 2121) |
||
Line 275: | Line 275: | ||
<pre>#! /bin/bash |
<pre>#! /bin/bash |
||
for((i=2009; i <= |
for((i=2009; i <= 2121; i++)) |
||
do |
do |
||
date -d "$i-12-25" |grep Sun |
date -d "$i-12-25" |grep Sun |
||
Line 295: | Line 295: | ||
I.e., starting from year 2038, the <tt>date</tt> command (which uses the glibc library, at least on GNU systems), is not able to recognise the date as a valid one! |
I.e., starting from year 2038, the <tt>date</tt> command (which uses the glibc library, at least on GNU systems), is not able to recognise the date as a valid one! |
||
===Different machine/OS version |
===Different machine/OS version (64 bit)=== |
||
This is the same command run on RedHat Linux. |
This is the same command run on RedHat Linux. |
||
<pre>bash-3.00$ date --version |
<pre>bash-3.00$ date --version |
||
Line 306: | Line 306: | ||
bash-3.00$ uname -a |
bash-3.00$ uname -a |
||
Linux brslln01 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:56:44 EST 2007 x86_64 x86_64 x86_64 GNU/Linux |
Linux brslln01 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:56:44 EST 2007 x86_64 x86_64 x86_64 GNU/Linux |
||
bash-3.00$ for((i=2009; i <= |
bash-3.00$ for((i=2009; i <= 2121; i++)); do date -d "$i-12-25" |egrep Sun; done |
||
Sun Dec 25 00:00:00 GMT 2011 |
Sun Dec 25 00:00:00 GMT 2011 |
||
Sun Dec 25 00:00:00 GMT 2016 |
Sun Dec 25 00:00:00 GMT 2016 |
||
Line 320: | Line 320: | ||
Sun Dec 25 00:00:00 GMT 2089 |
Sun Dec 25 00:00:00 GMT 2089 |
||
Sun Dec 25 00:00:00 GMT 2095 |
Sun Dec 25 00:00:00 GMT 2095 |
||
Sun Dec 25 00:00:00 GMT 2101 |
|||
Sun Dec 25 00:00:00 GMT 2107 |
|||
Sun Dec 25 00:00:00 GMT 2112 |
|||
Sun Dec 25 00:00:00 GMT 2118 |
|||
bash-3.00$</pre> |
bash-3.00$</pre> |