{"id":10275,"date":"2016-02-25T15:40:17","date_gmt":"2016-02-25T07:40:17","guid":{"rendered":"http:\/\/localhost\/help\/p2-server\/calculations\/time-periods\/calendar-periods\/"},"modified":"2024-07-04T16:01:11","modified_gmt":"2024-07-04T08:01:11","slug":"calendar-periods","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/time-periods\/calendar-periods\/","title":{"rendered":"Calendar Periods"},"content":{"rendered":"\n<h2><span id=\"Format\">Format<\/span><\/h2>\n<p class=\"intro-text\">IFS OI Server provides functions for calculating the time of specific calendar periods. The functions all require the same parameters and are used in the same way, but produce a result relevant to the function.\u00a0<\/p>\n<h2>Functions<\/h2>\n<table class=\"toc-table\">\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"270\"><strong>Format<\/strong><\/td>\n<td><strong>Returns<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>CalendarDayStart(Time [,TimeZone])<\/strong><\/td>\n<td>The time of midnight on the morning of the day of the provided Time.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>CalendarMonthEnd(Time [,TimeZone])<\/strong><\/td>\n<td>The time of the end of the calendar month, which started on or before the provided Time. That is, <strong>23:59:59<\/strong> on the last day.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>CalendarMonthStart(Time [,TimeZone])<\/strong><\/td>\n<td>The time of the start of the calendar month, occurring on or before the provided Time.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>CalendarWeekEnd(Time [,TimeZone])<\/strong><\/td>\n<td>The time of midnight on the morning of the first day of the week occurring after the provided Time.\u00a0That is, the end of the week which started on or before the provided Time.\u00a0Assumes that the week starts on the day specified by the data value.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>CalendarWeekEnd2(Time [,TimeZone])<\/strong><\/td>\n<td>The time of midnight on the Sunday morning occurring after the provided Time.\u00a0That is, the end of the calendar week which started on or before the provided Time, assuming Sunday is the first day of the week.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>CalendarWeekStart(Time [,TimeZone])<\/strong><\/td>\n<td>The time of midnight on the morning of the first day of the week occurring on or before the provided Time.\u00a0Assumes that the week starts on the day specified by the data value.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>CalendarWeekStart2(Time [,TimeZone])<\/strong><\/td>\n<td>The time of midnight on the Sunday morning occurring on or before the provided Time.\u00a0That is, the start of the calendar week, assuming Sunday is the first day of the week.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>DaysInMonth(Time [,TimeZone])<\/strong><\/td>\n<td>The number of days in the month of the provided <em>Time<\/em>.\u00a0<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>Midnight(Time [,TimeZone])<\/strong><\/td>\n<td>The time of the midnight occurring on or before the provided <em>Time<\/em>.\u00a0That is, the start of the day.\u00a0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span id=\"Parameters\">Inputs<\/span><\/h2>\n<p class=\"intro-text\"><strong>Time<\/strong>: The time from which to calculate the start of the calendar period.<br \/>\nBehaviour: Required<br \/>\nDimension: Collection, SingleValue, MultiCollection<br \/>\nValid data types: DateTime, Decimal, Integer, String<\/p>\n<p class=\"left-bar-p2blue\">Note: You can use the <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/time\/\">Time<\/a>() function to use a valid DateTime argument.<\/p>\n<p class=\"intro-text\"><strong>TimeZone<\/strong>: The geographical or UTC offset\u00a0time zone (e.g. \"Australia\/Perth\" or \"UTC+08:00\"). If not supplied, it assumes the configured calendar time zone.\u00a0<br \/>\nBehaviour:\u00a0Optional<br \/>\nDimension: SingleValue<br \/>\nValid data types: String<\/p>\n<p class=\"left-bar\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/calculation-syntax\/#Data_Type\">How to format data types<\/a><\/p>\n<h2><span id=\"Examples\">Examples<\/span><\/h2>\n<p class=\"intro-text\">Expression: <span class=\"code-fragment\">Midnight({utc'2017-06-13 18:29'}, \"Australia\/Perth\")<\/span><br \/>\nResult: <span style=\"color: #0000ff;\">14\/06\/2017 12:00 AM<\/span><\/p>\n<p class=\"intro-text\">Expression: <span class=\"code-fragment\">Midnight(Time(), \"Australia\/Perth\")<\/span><br \/>\nResult: The time at midnight in the specified time zone.<br \/>\nE.g. <span style=\"color: #0000ff;\">14\/06\/2017 12:00 AM<\/span><\/p>\n<h2><span id=\"Release_History\">Release History<\/span><\/h2>\n<ul class=\"intro-text\">\n<li>Calendar Periods 4.6.5\n<ul class=\"intro-text\">\n<li>Changed Time parameter to support MultiCollection values.<\/li>\n<\/ul>\n<\/li>\n<li>Calendar Periods 4.0\n<ul class=\"intro-text\">\n<li>Initial version<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p class=\"intro-text\">\u00a0<\/p>\n<p class=\"intro-text\">\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IFS OI Server provides functions for calculating the time of specific calendar periods. The functions are: CalenderDayStart, CalendarMonthEnd, CalendarMonthStart, CalendarWeekend, CalendarWeekend2, CalendarWeekStart, CalendarWeekStart2, Midnight, DaysInMonth.<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/time-periods\/calendar-periods\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":10282,"parent":9756,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[9],"tags":[100,409],"class_list":["post-10275","page","type-page","status-publish","has-post-thumbnail","hentry","category-tech-ref","tag-calculations","tag-calendar-periods","Version-4-0","Version-4-6-5","Product-srv"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/10275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/comments?post=10275"}],"version-history":[{"count":5,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/10275\/revisions"}],"predecessor-version":[{"id":67793,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/10275\/revisions\/67793"}],"up":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/9756"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media\/10282"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=10275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=10275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=10275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}