Day of the week on Display

Brian E. Doty doty at COLA.IGES.ORG
Fri Apr 29 10:19:12 EDT 2005


If you do a 'query time' command from within GrADS,
you get the current time and date and day of the week
(if the date is within a certain range of years, which
offhand I forget).  This is for whatever the current
dimension environment is set to.

I have a small GrADS script function I use to format this
for display.  An example of using this is:

  'draw title Data for 'mydate()


Here is the function:      ...Brian

-------------------------------------------------------------

*  Function to reformat the GrADS date/time into something
*  more readable

function mydate
  'query time'
  sres = subwrd(result,3)
  wday = subwrd(result,6)
  i = 1
  while (substr(sres,i,1)!='Z')
    i = i + 1
  endwhile
  hour = substr(sres,1,i)
  isav = i
  i = i + 1
  while (substr(sres,i,1)>='0' & substr(sres,i,1)<='9')
    i = i + 1
  endwhile
  day = substr(sres,isav+1,i-isav-1)
  month = substr(sres,i,3)
  year = substr(sres,i+3,4)
  return (hour' 'wday' 'day' 'month', 'year)



More information about the gradsusr mailing list