<!DOCTYPE KSpreadFunctions>
<KSpreadFunctions>

  <Group>
    <GroupName>Date and Time</GroupName>

    <Function>
      <Name>WEEKS</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>First (earlier) date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Second date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Calculation mode</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The WEEKS() function returns the difference between two dates in weeks.The third parameter indicates the calculation mode: if the mode is 0, WEEKS() returns the maximal possible number of weeks between those days. If the mode is 1, it only returns the number of whole weeks in between.</Text>
	<Syntax>WEEKS(date2; date1; mode)</Syntax>
	<Example>WEEKS("2002-02-18"; "2002-02-26"; 0) returns 1, because there is one week and 1 day in between</Example>
	<Example>WEEKS("2002-19-02"; "2002-19-02"; 1) returns 0, because there is not a whole week in between, starting at the first day of the week (monday or sunday, depending on your local settings)</Example>
      </Help>
    </Function>

    <Function>
      <Name>MONTHS</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>First (earlier) date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Second date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Calculation mode</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The MONTHS() function returns the difference between two dates in months.The third parameter indicates the calculation mode: if the mode is 0, MONTHS() returns the maximal possible number of months between those days. If the mode is 1, it only returns the number of complete months in between.</Text>
	<Syntax>MONTHS(date2; date1; mode)</Syntax>
	<Example>MONTHS("2002-01-18"; "2002-02-26"; 0) returns 1, because there is 1 month and 8 days in between</Example>
	<Example>MONTHS("2002-01-19"; "2002-02-26"; 1) returns 0, because there is not a whole month in between, starting at the first day of the month</Example>
      </Help>
    </Function>

    <Function>
      <Name>YEARS</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>First (earlier) date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Second date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Calculation mode</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The YEARS() function returns the difference between two dates in years. The third parameter indicates the calculation mode: if the mode is 0, YEARS() returns the maximal possible number of years between those days. If the mode is 1, it only returns whole years, starting at the 1st Jan and ending on the 31st Dec.</Text>
	<Syntax>YEARS(date2; date1; mode)</Syntax>
	<Example>YEARS("2001-02-19"; "2002-02-26"; 0) returns 1, because there is one year and 7 days in between</Example>
	<Example>YEARS("2002-02-19"; "2002-02-26"; 1) returns 0, because there is not a whole year in between, starting at the first day of the year</Example>
      </Help>
    </Function>

    <Function>
      <Name>DAYS</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>First (earlier) date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Second date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The DAYS() function returns the difference between two dates in days.</Text>
	<Syntax>DAYS(date2; date1)</Syntax>
	<Example>DAYS("2002-02-22"; "2002-02-26") returns 4</Example>
      </Help>
    </Function>

    <Function>
      <Name>DAYOFYEAR</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Year</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Month</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Day</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The DAYOFYEAR() function returns the number of the day in the year (1...365).</Text>
	<Syntax>DAYOFYEAR(year;month;date)</Syntax>
	<Example>DAYOFYEAR(2000;12;1) returns 336</Example>
	<Example>DAYOFYEAR(2000;2;29) returns 60</Example>
      </Help>
    </Function>

    <Function>
      <Name>DATE</Name>
      <Type>String</Type>
      <Parameter>
	<Comment>Year</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Month</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Day</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The DATE() function returns the date formatted with local parameters.</Text>
	<Syntax>DATE(year;month;date)</Syntax>
	<Example>DATE(2000;5;5) returns Friday 05 May 2000</Example>
      </Help>
    </Function>

    <Function>
      <Name>TIME</Name>
      <Type>String</Type>
      <Parameter>
	<Comment>Hours</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Minutes</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Seconds</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The TIME() function returns the time formatted with local parameters.</Text>
	<Syntax>TIME(hours;minutes;seconds)</Syntax>
	<Example>TIME(10;2;2) returns 10:02:02</Example>
        <Example>TIME(10;70;0) returns 11:10:0</Example>
        <Example>TIME(10;-40;0) returns 9:20:0</Example>
      </Help>
    </Function>
    
    <Function>
     <Name>HOURS</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>time</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The HOURS() function returns the value of the hours in a time expression.</Text>
	<Syntax>HOURS(time)</Syntax>
	<Example>HOURS("10:5:2") returns 10</Example>
      </Help>
    </Function>

    <Function>
     <Name>ISLEAPYEAR</Name>
      <Type>Boolean</Type>
      <Parameter>
	<Comment>year</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The function isLeapYear() returns True if the given year is leap.</Text>
	<Syntax>ISLEAPYEAR(year)</Syntax>
	<Example>ISLEAPYEAR(2000) returns True</Example>
      </Help>
    </Function>

    <Function>
     <Name>DAYSINMONTH</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>year</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>month</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The function DAYSINMONTH() returns number of days in the given year and month.</Text>
	<Syntax>DAYSINMONTH(year;month)</Syntax>
	<Example>DAYSINMONTH(2000;2) returns 29</Example>
      </Help>
    </Function>

    <Function>
     <Name>DAYSINYEAR</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>year</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The function DAYSINYEAR() returns the number of days in the given year.</Text>
	<Syntax>DAYSINYEAR(year)</Syntax>
	<Example>DAYSINYEAR(2000) returns 366</Example>
      </Help>
    </Function>

    <Function>
     <Name>WEEKSINYEAR</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>year</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The function WEEKSINYEAR() returns the number of weeks in the given year.</Text>
	<Syntax>WEEKSINYEAR(year)</Syntax>
	<Example>WEEKSINYEAR(2000) returns 52</Example>
      </Help>
    </Function>

    <Function>	  
     <Name>MINUTES</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>time</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The MINUTES() function returns the value of the minutes in a time expression.</Text>
	<Syntax>MINUTES(time)</Syntax>
	<Example>MINUTES("10:5:2") returns 5</Example>
      </Help>
    </Function>

    <Function>
     <Name>SECONDS</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>time</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The SECONDS() function returns the value of the seconds in a time expression.</Text>
	<Syntax>SECONDS(time)</Syntax>
	<Example>SECONDS("10:5:2") returns 2</Example>
      </Help>
    </Function>

    <Function>
      <Name>DAY</Name>
      <Type>String</Type>
      <Parameter>
	<Comment>Number of day in week (1..7)</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The DAY() function returns the name of the day of the week (1..7). In some countries the first day of the week is Monday, while in others the first day of the week is Sunday.</Text>
	<Syntax>DAY(weekday)</Syntax>
	<Example>DAY(1) returns Monday (if the week starts on Monday)</Example>
      </Help>
    </Function>

    <Function>
      <Name>MONTH</Name>
      <Type>String</Type>
      <Parameter>
	<Comment>Number of month (1..12)</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The MONTH() function returns the name of the month (1...12).</Text>
	<Syntax>MONTH(number)</Syntax>
	<Example>MONTH(5) returns May</Example>
      </Help>
    </Function>

    <Function>
      <Name>CURRENTDATE</Name>
      <Type>String</Type>
      <Help>
	<Text>The CURRENTDATE() function returns the current date formatted with local parameters.</Text>
	<Syntax>CURRENTDATE()</Syntax>
	<Example>CURRENTDATE() returns "Saturday 13 April 2002"</Example>
      </Help>
    </Function>

    <Function>
      <Name>SHORTCURRENTDATE</Name>
      <Type>String</Type>
      <Help>
	<Text>The SHORTCURRENTDATE() function returns the current date formatted with local parameters.</Text>
	<Syntax>SHORTCURRENTDATE()</Syntax>
	<Example>SHORTCURRENTDATE() returns "04/13/02"</Example>
      </Help>
    </Function>

    <Function>
      <Name>CURRENTDATETIME</Name>
      <Type>String</Type>
      <Help>
	<Text>The CURRENTDATETIME() function returns the current date and time formatted with local parameters.</Text>
	<Syntax>CURRENTDATETIME()</Syntax>
	<Example>CURRENTDATETIME() returns "Saturday 13 April 2002 19:12:01"</Example>
      </Help>
    </Function>

    <Function>
      <Name>CURRENTTIME</Name>
      <Type>String</Type>
      <Help>
	<Text>The CURRENTTIME() function returns the current time formatted with local parameters.</Text>
	<Syntax>CURRENTTIME()</Syntax>
	<Example>CURRENTTIME() returns "19:12:01"</Example>
      </Help>
    </Function>

  </Group>

</KSpreadFunctions>
