login

dayofyear.gsf

Top / GrADS / script / dayofyear.gsf

Japanese / English

Name

dayofyear() - Get day-of-year from time. Or, get date from day-of-year, assuming no leap year.

Synopsis (1)

ret = dayofyear( time )

Options and Return values

time
GrADS-style time, For example, "15feb2001".
ret
Day of year, assuming January 1st is 1.

Synopsis (2)

ret = dayofyear( day-of-year )

Options and Return values

day-of-year
Day of year, assuming January 1st is 1.
ret
Date.

Examples

(1) Show day of year of 15 March 2004.

  • test.gs
    rc = gsfallow( 'on' )
    say dayofyear( '15mar2004' )
    
  • console
    ga-> test
    75
    

(1) Show date of day-of-year=360.

  • test.gs
    rc = gsfallow( 'on' )
    say dayofyear( 360 )
    
  • console
    ga-> test
    26Dec
    

Script source code