home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / DATABASE / KPHANDYP.LBR / GETXTIME.CZD / GETXTIME.CMD
OS/2 REXX Batch file  |  2000-06-30  |  3KB  |  118 lines

  1. store 722099+peek(63732)+peek(63733)*256 to x
  2. store int(x/365.26)+1 to y
  3. store x+int(395.25-365.25*y) to d
  4. if int(y/4)*4=y
  5.    store 1 to d1
  6. else
  7.    store 2 to d1
  8. endif
  9. if d>(91-d1)
  10.    store d+d1 to d
  11. endif
  12. store int(d/30.57) to m
  13. store d-int(30.57*m) to d
  14. if m>12
  15.    store 1 to m
  16.    store y+1 to y
  17. endif
  18. store y-1900 to y
  19. store str(m,2)+'/'+str(d,2)+'/'+str(y,2) to date
  20. set date to &date
  21. store date() to holddate
  22. store x+(int(-x/7)*7) to x
  23. if x=0
  24.    store 'Saturday, ' to today
  25. else
  26.    if x=1
  27.       store 'Sunday, ' to today
  28.    else
  29.       if x=2
  30.          store 'Monday, ' to today
  31.       else
  32.          if x=3
  33.             store 'Tuesday, ' to today
  34.          else
  35.             if x=4
  36.                store 'Wednesday, ' to today
  37.             else
  38.                if x=5
  39.                   store 'Thursday, ' to today
  40.                else
  41.                   store 'Friday, ' to today
  42.                endif 5
  43.             endif 4
  44.          endif 3
  45.       endif 2
  46.    endif 1
  47. endif 0
  48. if m=1
  49.    store today+'January 'to today
  50. else
  51.    if m=2
  52.       store today+'February ' to today
  53.    else
  54.       if m=3
  55.          store today+'March ' to today
  56.       else
  57.          if m=4
  58.             store today+'April ' to today
  59.          else
  60.             if m=5
  61.                store today+'May ' to today
  62.             else
  63.                if m=6
  64.                   store today+'June ' to today 
  65.                else
  66.                   if m=7
  67.                      store today+'July ' to today
  68.                   else
  69.                      if m=8
  70.                         store today+'August ' to today
  71.                      else
  72.                         if m=9
  73.                            store today+'September ' to today
  74.                         else
  75.                            if m=10
  76.                               store today+'October ' to today
  77.                            else
  78.                               if m=11
  79.                                  store today+'November ' to today
  80.                               else
  81.                                  store today+'December ' to today
  82.                               endif 11
  83.                            endif 10
  84.                         endif 9
  85.                      endif 8
  86.                   endif 7
  87.                endif 6
  88.             endif 5
  89.          endif 4
  90.       endif 3
  91.    endif 2
  92. endif 1
  93. store today+str(d,2)+', 19'+str(y,2) to today
  94. store peek(63734) to hour
  95. store peek(63735) to min
  96. store hour-6*int(hour/16) to hour
  97. store min-6*int(min/16) to min
  98. if hour>12 .or. hour=12
  99.    store hour-12 to hour
  100.    store ' p.m. '+today to today
  101. else
  102.    store ' a.m. '+today to today
  103. endif
  104. if hour=0
  105.    store 12 to hour
  106. endif
  107. if min<10
  108.    store '0'+str(min,1) to minute
  109. else
  110.    store str(min,2) to minute
  111. endif
  112. store str(hour,2)+':'+minute+today to today
  113. return
  114. ore '0'+str(min,1) to minute
  115. else
  116.    store str(min,2) to minute
  117. endif
  118. store