EASY way to add n days to a date?

Jacques Hausser jacques.hausser at unil.ch
Sat Dec 19 18:35:46 EST 2009


Le 20 déc. 2009 à 00:20, James Hurley a écrit :

> In FileMaker it is possible to add n (an integer) to a date to get a new date n days hence.
> 
> Is there an EASY way to do this in Rev? (I don't mean setting the idemdel to "/" and fussing with the day/month/year digits.)
> 


Something like:

function addDays mydate,ndays
   convert mydate [from short system date] to seconds
   add ndays * 86400 to mydate
   convert mydate from seconds to [short, abbreviated...] system date
   return mydate
end addDays

Jacques


******************************************
Prof. Jacques Hausser
Department of Ecology and Evolution
Biophore / Sorge
University of Lausanne
CH 1015 Lausanne
please use my private address:
6 route de Burtigny
CH-1269 Bassins
tel/fax: 	++ 41 22 366 19 40
mobile:	++ 41 79 757 05 24
E-Mail:	jacques.hausser at unil.ch
*******************************************




More information about the use-livecode mailing list