Date year span: Difference between revisions

From ENIGMA
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{FuncTitle|date_year_span|date1,date2}}
{{FuncTitle|date_year_span|date1,date2}}
== Description ==
== Description ==
General description of the function.
Gets the span between the two date-time values in years and returns the result with the remainder as a fraction, for instance 1.5 for 1 and 1/2 years.


== Parameters ==
== Parameters ==
Line 7: Line 7:
! Parameter !! Data Type !! Description
! Parameter !! Data Type !! Description
|-
|-
| date1 || time_t ||
| date1 || time_t || the first date-time value
|-
|-
| date2 || time_t ||
| date2 || time_t || the second date-time value
|}
|}


== Return Values ==
== Return Values ==
'''double''': Returns...
'''double''': Returns the span in years between the two date-time values.


== Example Call ==
== Example Call ==
<syntaxhighlight lang="edl">
<syntaxhighlight lang="edl">
// Example of using the function.
// demonstrates getting the span in years between today and January 1st 2001
var span;
span = date_year_span(date_create_date(2001, 1, 1), date_current_date());
</syntaxhighlight>
</syntaxhighlight>



Latest revision as of 02:10, 29 April 2014

Description

Gets the span between the two date-time values in years and returns the result with the remainder as a fraction, for instance 1.5 for 1 and 1/2 years.

Parameters

Parameter Data Type Description
date1 time_t the first date-time value
date2 time_t the second date-time value

Return Values

double: Returns the span in years between the two date-time values.

Example Call

// demonstrates getting the span in years between today and January 1st 2001
var span;
span = date_year_span(date_create_date(2001, 1, 1), date_current_date());