Home > atmlab > time > daysinyear.m

daysinyear

PURPOSE ^

DAYSINYEAR Number of days in a year.

SYNOPSIS ^

function diy = daysinyear(year)

DESCRIPTION ^

DAYSINYEAR Number of days in a year.

   DAYSINYEAR(YEAR) returns the number of days in the given year.

   If no year is specified, the current year is used.  Gregorian calendar
   is assumed.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

daysinyear.m

SOURCE CODE ^

0001 function diy = daysinyear(year)
0002 %DAYSINYEAR Number of days in a year.
0003 %
0004 %   DAYSINYEAR(YEAR) returns the number of days in the given year.
0005 %
0006 %   If no year is specified, the current year is used.  Gregorian calendar
0007 %   is assumed.
0008 
0009 %   Author:      Peter J. Acklam
0010 %   Time-stamp:  2002-03-03 12:51:58 +0100
0011 %   E-mail:      pjacklam@online.no
0012 %   URL:         http://home.online.no/~pjacklam
0013 
0014    if nargin < 1
0015       clk = clock;
0016       year = clk(1);
0017    end
0018 
0019    diy = 365 + isleapyear(year);

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005