{"id":1015,"date":"2008-10-12T23:04:26","date_gmt":"2008-10-13T06:04:26","guid":{"rendered":"http:\/\/members.crystalreportsbook.com\/books\/?p=1015"},"modified":"2012-05-08T10:33:47","modified_gmt":"2012-05-08T17:33:47","slug":"9-7-date-and-time-functions","status":"publish","type":"post","link":"http:\/\/www.crystalreportsonlinetraining.com\/training\/9-7-date-and-time-functions\/","title":{"rendered":"9.07 Date and Time Functions"},"content":{"rendered":"<h1>Date and Time Functions<\/h1>\n<p>         <b>Table 9-10. Date and Time Functions<\/b><\/p>\n<table border=\"1\">\n<tr>\n<th>Function Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>CurrentDate, CurrentTime,CurrentDateTime<\/td>\n<td>Returns the current date and\/or time.<\/td>\n<\/tr>\n<tr>\n<td>DateSerial(year, month, day),DateTime(hour, minute, second)<\/td>\n<td>Returns a date or time.<\/td>\n<\/tr>\n<tr>\n<td>DateAdd(interval, number, date)<\/td>\n<td>Increases the date by a certain interval.<\/td>\n<\/tr>\n<tr>\n<td>DateDiff(interval, startdate, enddate, firstdayofweek)<\/td>\n<td>Finds the difference between two dates.<\/td>\n<\/tr>\n<tr>\n<td>DatePart(interval, date, firstdayofweek, firstweekofyear)<\/td>\n<td>Returns a number representing the current interval of a date.<\/td>\n<\/tr>\n<tr>\n<td>MonthName(integer, abbreviate)<\/td>\n<td>Returns the full month name. Return the 3-letter abbreviation if the second parameter is True.<\/td>\n<\/tr>\n<tr>\n<td>Timer<\/td>\n<td>The number of seconds that have elapsed since midnight.<\/td>\n<\/tr>\n<tr>\n<td>WeekDay(date, firstdayofweek)<\/td>\n<td>Returns a number representing the day of the week.<\/td>\n<\/tr>\n<tr>\n<td>WeekdayName(weekday, abbreviate, firstdayofweek)<\/td>\n<td>Returns the full month name. Return the 3-letter abbreviation if the second parameter is True.<\/td>\n<\/tr>\n<\/table>\n<p>         <b>Table 9-11. Interval Strings for DateAdd(), DateDiff() and DatePart()<\/b><\/p>\n<table border=\"1\">\n<tr>\n<th>String<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>&#8220;yyyy&#8221;<\/td>\n<td>Year<\/td>\n<\/tr>\n<tr>\n<td>&#8220;q&#8221;<\/td>\n<td>Quarter<\/td>\n<\/tr>\n<tr>\n<td>&#8220;m&#8221;<\/td>\n<td>Month (1 through 12)<\/td>\n<\/tr>\n<tr>\n<td>&#8220;ww&#8221;<\/td>\n<td>Week of the year (1 through 53)<\/td>\n<\/tr>\n<tr>\n<td>&#8220;w&#8221;<\/td>\n<td>Day of the week (1 through 7)<\/td>\n<\/tr>\n<tr>\n<td>&#8220;y&#8221;<\/td>\n<td>Day of year (1 through 366)<\/td>\n<\/tr>\n<tr>\n<td>&#8220;d&#8221;<\/td>\n<td>Day part of the date (1 through 31)<\/td>\n<\/tr>\n<tr>\n<td>&#8220;h&#8221;<\/td>\n<td>Hour<\/td>\n<\/tr>\n<tr>\n<td>&#8220;n&#8221;<\/td>\n<td>Minute<\/td>\n<\/tr>\n<tr>\n<td>&#8220;s&#8221;<\/td>\n<td>Second<\/td>\n<\/tr>\n<\/table>\n<p>The date and time functions that come with .NET pale in comparison to what you can do with Crystal Reports. Although many of the Basic syntax functions are similar to their .NET counterparts, they give you more functionality. You can also combine different functions together to create very powerful date calculations. There are a lot of new concepts to learn.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Date and Time Functions Table 9-10. Date and Time Functions Function Name Description CurrentDate, CurrentTime,CurrentDateTime Returns the current date and\/or time. DateSerial(year, month, day),DateTime(hour, minute, second) Returns a date or time. DateAdd(interval, number, date) Increases the date by a certain interval. DateDiff(interval, startdate, enddate, firstdayofweek) Finds the difference between two dates. DatePart(interval, date, firstdayofweek, firstweekofyear) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55,40],"tags":[],"class_list":["post-1015","post","type-post","status-publish","format-standard","hentry","category-chapter-9-built-in-functions","category-crystal-reportsnet-2008","entry"],"_links":{"self":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts\/1015","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/comments?post=1015"}],"version-history":[{"count":2,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts\/1015\/revisions"}],"predecessor-version":[{"id":1919,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts\/1015\/revisions\/1919"}],"wp:attachment":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/media?parent=1015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/categories?post=1015"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/tags?post=1015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}