Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Number of Days in the Month, Quarter, or Year

Returns the number of days in the month, quarter, or year for the specified date.

month_days(date)

Returns the number of days in the month for the specified date.
1q = foreach q generate month_days(toDate('CloseDate_sec_epoch')) as 'Billing Days In Month';

quarter_days(date)

Returns the number of days in the quarter for the specified date.
1q = foreach q generate quarter_days(toDate('CloseDate_sec_epoch')) as 'Billing Days In Quarter;

year_days(date)

Returns the number of days in the year for the specified date.
1q = foreach q generate year_days(toDate('CloseDate_sec_epoch')) as 'Billing Days In Year;