silogarrett Posted August 30, 2011 Share Posted August 30, 2011 Hello Guru! I need to compare the time elapsed between a day/month/year in the past, to the current day/month/year, to ascertain the years in decimal form - that is: 29/04/2008 to today, 29/08/2011 = 3.3342 years. Is the a way to state a date in decimal form, so that one could do addition or subtraction on two dates? Mike Link to comment Share on other sites More sharing options...
AzeoTech Posted August 31, 2011 Share Posted August 31, 2011 I think what you want is the strToTime() function. See section 4.12.11 in the user's guide. Its pretty self explanatory. You could also, technically, parse the date into its component year, month, and day parts, then use hms formatting (section 4.9) with evaluate(), but strToTime() is much easier and cleaner. Note that the result is in seconds since 1970, so you'll need to divide the difference by the number of seconds in a year. I'll let you determine how you want to deal with leap years. Link to comment Share on other sites More sharing options...
silogarrett Posted December 27, 2011 Author Share Posted December 27, 2011 Thank you!! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.