Date formula examples

The following examples include date formulas that can be used in Practice CS. The Output Examples represent running these formulas on Friday, May 5, 2017.
[Date Span("Year", Minimum Date, Maximum Date)]
Output: 178
[Day(Report Date)]
Output: 5
[Day Of Week(Report Date)]
Output: 6
[Day Of Year(Report Date)]
Output: 125
[Days In Month(Report Date)]
Output: 31
[Month(Report Date)]
Output: 5
[Time Span("Hour", Minimum Date, Maximum Date)]
Output: 1569096
[Year(Report Date)]
Output: 2017
[Add Days(Report Date, 1)]
Output: 5/7/2017 12:00:00 AM
[Date(Year(Report Date), 12, 31)]
Output: 12/31/2017 12:00:00 AM
The current date is: [Date Format(Date Time Now, "dddd, MMMM d, yyyy")]
Output: The current date is: Friday, May 5, 2017
The minimum date is: [Date Format(Minimum Date, "d MMMM yyyy")]
Output: The minimum date is: 1 January 1900
The maximum date is: [Date Format(Maximum Date, "yyyy-MM-dd")]
Output: The maximum date is: 2079-01-01
My birthday is [Date Format(Date(1953, 4, 10), "MMMM d, yyyy")]
Output: My birthday is April 10, 1953
Today is: [Date Format(Date Time Now, "dddd")]
Output: Today is: Friday
This month is: [Date Format(Date Time Now, "MMMM")]
Output: This month is: May
This year is: [Year(Date Time Now)]
Output: This year is: 2017
Today is day [Day(Date Time Now)] of month [Month(Date Time Now)] of year [Year(Date Time Now)]
Output: Today is day 5 of month 5 of year 2017
[Date Format(Date Time Now, "dddd")] is day [Day Of Week(Date Time Now)] of 7
Output: Friday is day 6 of 7
[Date Format(Date Time Now, "d MMM yy")] is day [Day Of Year(Date Time Now)] of [Day Of Year(Year End Date(Date Time Now, 0))]
Output: 5 May 17 is day 125 of 365
There are [Days In Month(Date(2013, 2, 1))] days in [Date Format(Date(2013, 2, 1), "MMMM yyyy")]
Output: There are 28 days in February 2017
This month is from [Date Format(Month Begin Date(Date Time Now, 0), "d MMMM yyyy")] to [Date Format(Month End Date(Date Time Now, 0), "d MMMM yyyy")]
Output: This month is from 1 May 2017 to 31 May 2017
Last month was from [Date Format(Month Begin Date(Date Time Now, -1), "d MMMM yyyy")] to [Date Format(Month End Date(Date Time Now, -1), "d MMMM yyyy")]
Output: Last month was from 1 April 2017 to 30 April 2017
Next month is from [Date Format(Month Begin Date(Date Time Now, 1), "d MMMM yyyy")] to [Date Format(Month End Date(Date Time Now, 1), "d MMMM yyyy")]
Output: Next month is from 1 June 2017 to 30 June 2017
There are [Truncate(Date Span("Day", Date(2013, 1, 1), Date(2013, 5, 31)) + 1)] days in the period beginning on [Date Format(Date(2013, 1, 1), "MMM d")] and ending on [Date Format(Date(2013, 5, 31), "MMM d yyyy")]
Output: There are 151 days in the period beginning on Jan 1 and ending on May 31 2013
Your next Individual Federal Tax Return is due [IF((Date(Year(Date Time Now), 2, 15) < Date Time Now), "next year on " + Date Format(Add Months(Date(Year(Date Time Now), 2, 15), 12), "MMMM d, yyyy"), "this year on " + Date Format(Date(Year(Date Time Now), 2, 15), "MMMM d, yyyy"))]
Output: Your next Individual Federal Tax Return is due next year on February 15, 2018.

Related content