<p dir="ltr">Win!</p>
<br><div class="gmail_quote"><div dir="ltr">On Tue, 24 May 2016 5:21 pm Nyall Dawson <<a href="mailto:nyall.dawson@gmail.com">nyall.dawson@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 23 May 2016 at 21:21, Richard Duivenvoorde <<a href="mailto:richard@duif.net" target="_blank">richard@duif.net</a>> wrote:<br>
> Nyall Dawson schreef op 2016-05-23 11:41:<br>
>>><br>
>>> But now it would be cool to check the time-difference between those two<br>
>>> (called timespan?).<br>
>>> I did not find a function for those...<br>
>><br>
>><br>
>> Use the age() function. That takes two datetimes and returns an<br>
>> interval length between them. You can extract the<br>
>> seconds/minutes/hours/etc from an interval type using the seconds(),<br>
>> minutes(), ... etc functions.<br>
>><br>
>> Hope that helps!<br>
><br>
><br>
> Ah :-) definitely... Did find see that one...<br>
<br>
FYI - as of <a href="https://github.com/qgis/QGIS/commit/8ddcf76" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS/commit/8ddcf76</a> you can now<br>
just directly calculate date/time/datetime differences using "-", eg<br>
<br>
to_date('2016-03-04')-to_date('2016-03-01')<br>
<br>
This will return an interval object which you can then use seconds(),<br>
minute(), etc on.<br>
<br>
Nyall<br>
<br>
<br>
><br>
> Thanks!<br>
><br>
> Richard<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a></blockquote></div>