summaryrefslogtreecommitdiff log msg author committer range
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104   DATEDIF /text/scalc/01/func_datedif.xhp DATEDIF function DATEDIF This function returns the number of whole days, months or years between Start date and End date. Syntax DATEDIF(Start date; End date; Interval) Start date is the date from when the calculation is carried out. End date is the date until the calculation is carried out. End date must be later, than Start date. Interval is a string, accepted values are "d", "m", "y", "ym", "md" or "yd". Value for "Interval"Do not translate the text values in this column below Return value "d" Number of whole days between Start date and End date. "m" Number of whole months between Start date and End date. "y" Number of whole years between Start date and End date. "ym" Number of whole months when subtracting years from the difference of Start date and End date. "md" Number of whole days when subtracting years and months from the difference of Start date and End date. "yd" Number of whole days when subtracting years from the difference of Start date and End date. Example Birthday calculation. A man was born on 1974-04-17. Today is 2012-06-13. =DATEDIF("1974-04-17";"2012-06-13";"y") yields 38. =DATEDIF("1974-04-17";"2012-06-13";"ym") yields 1. =DATEDIF("1974-04-17";"2012-06-13";"md") yields 27. So he is 38 years, 1 month and 27 days old. =DATEDIF("1974-04-17";"2012-06-13";"m") yields 457, he has been living for 457 months. =DATEDIF("1974-04-17";"2012-06-13";"d") yields 13937, he has been living for 13937 days. =DATEDIF("1974-04-17";"2012-06-13";"yd") yields 57, his birthday was 57 days ago.