====== Number of Days (Expression Function) ====== ===== Purpose ===== The **Number of Days** function (NUMBER_DAYS) generates a number of days between two timestamps. {{:number_days_initial.png?direct&600|}} ===== Parameters ===== The **Number of Days** function has three parameters, two of which are required: ==== Start Date Timestamp ==== Allowed Inputs: [[Field|field]] value or a number representing a Unix timestamp. There are several sources of Unix timestamps available. For example the stored value of a [[Field Type - Date|date]] or [[Field Type - Date Time| date time]] field is a Unix timestamp. Also When using the advanced interface the output of the [[Expression Function - Date|date]] or [[Expression Function - Date and Time| date time]] expression function is a Unix timestamp. ==== End Date Timestamp ==== Allowed Inputs: [[Field|field]] value or a number representing a Unix timestamp. There are several sources of Unix timestamps available. For example the stored value of a [[Field Type - Date|date]] or [[Field Type - Date Time| date time]] field is a Unix timestamp. Also When using the advanced interface the output of the [[Expression Function - Date|date]] or [[Expression Function - Date and Time| date time]] expression function is a Unix timestamp. ==== Timezone ==== Allowed Inputs: [[Field|field]] value or a text string The third optional parameter of the **Number of Days** function is a string that represents the timezone to be used when interpreting the timezone. Either use the query builder to choose a field that contains the value or use type a value to enter a number. The value should be based on the tz (timezone) database used by Linux and other Unix system in the form “Area/Location” e.g. "America/New_York". If no value is provided then the current user's timezone is used. ===== Output ===== The output of the **Number of Days** function is number representing the number of days between two timestamps. If less than 24 hours has elapsed between the two timestamps even if they are on two separate calendar days the result will be 0. ===== Example ===== For example NUMBER_DAYS('1305500461', '1305586861') will result in '1' and NUMBER_DAYS(1305500461,1305525461) will result in '0'.