Day of the Year (Expression Function)

Purpose

The Day of the Year function (DAY_OF_THE_YEAR) generates a number that represents the day of the year, starting from 0, for a timestamp provided in a given timezone.

Parameters

The Day of the Year function has two parameters, one of which is required:

Timestamp

Allowed Inputs: field value or a number representing a Unix timestamp.

There are several sources of Unix timestamps available. For example the stored value of a date or date time field is a Unix timestamp. Also When using the advanced interface the output of the date or date time expression function is a Unix timestamp.

Timezone

Allowed Inputs: field value or a text string

The second optional parameter of the Day of the Year function is a string that represents 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 Day of the Year function is number representing the day of the year, starting from zero. January 1st = 0 … December 31 = 364 in non-leap years and 365 in leap years.

Example

For example for Decmber 31, 2012 DAY_OF_THE_YEAR(1357009728,“America/New_York”) is “365” and for December 31, 2013 DAY_OF_THE_YEAR(1388546297,“America/New_York”) is “364”.

expression function - day of the year.txt · Last modified: 2016/09/14 14:19 (external edit)
Copyright WorkXpress, 2022