{"id":10271,"date":"2016-02-25T15:38:51","date_gmt":"2016-02-25T07:38:51","guid":{"rendered":"http:\/\/localhost\/help\/p2-server\/calculations\/time-periods\/durations\/"},"modified":"2024-07-04T16:03:17","modified_gmt":"2024-07-04T08:03:17","slug":"durations","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/time-periods\/durations\/","title":{"rendered":"Time Conversions"},"content":{"rendered":"\n<h2><span id=\"Format\">Format<\/span><\/h2>\n<p class=\"intro-text\">IFS OI Server provides functions for converting a time (in seconds since 1970 UTC) into a requested component value. 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>\n<td width=\"200\"><strong>Format<\/strong><\/td>\n<td><strong>Returns<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Second(Time [,TimeZone])<\/strong><\/td>\n<td>Converts the specified <em>Time<\/em> into the local time zone of the machine executing the calculation, and then returns the seconds component (a value from 0 to 59).<\/td>\n<\/tr>\n<tr>\n<td><strong>Minute(Time [,TimeZone])<\/strong><\/td>\n<td>Converts the specified <em>Time<\/em>\u00a0into the local time zone of the machine executing the calculation, and then returns the minutes component (a value from 0 to 59).<\/td>\n<\/tr>\n<tr>\n<td><strong>Hour(Time [,TimeZone])<\/strong><\/td>\n<td>Converts the specified <em>Time\u00a0<\/em>into the local time zone of the machine executing the calculation, and then returns the hour component (a value from 0 to 23).<\/td>\n<\/tr>\n<tr>\n<td><strong>Day(Time [,TimeZone])<\/strong><\/td>\n<td>Converts the specified <em>Time<\/em>\u00a0argument into the local time zone of the machine executing the calculation, and then returns the day of the month component (a value from 1 to 31).<\/td>\n<\/tr>\n<tr>\n<td><strong>WeekDay(Time [,TimeZone])<\/strong><\/td>\n<td>Converts the specified <em>Time<\/em> into the local time zone of the machine executing the calculation, and then returns the day of the week component (a value from 1 to 7, where 1 is Sunday and 7 is Saturday).<\/td>\n<\/tr>\n<tr>\n<td><strong>Month(Time [,TimeZone])<\/strong><\/td>\n<td>Converts the specified <em>Time\u00a0<\/em>into the local time zone of the machine executing the calculation, and then returns the month component (a value from 1 to 12 for January to December).<\/td>\n<\/tr>\n<tr>\n<td><strong>Year(Time [,TimeZone])\u00a0<\/strong><\/td>\n<td>Converts the specified <em>Time\u00a0<\/em>into the local time zone of the machine executing the calculation, and then returns the four-digit year component.<\/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 for\u00a0which to calculate the function.<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\">Second(Time(), \"Australia\/Perth\")<\/span><\/p>\n<p class=\"intro-text\">Expression: <span class=\"code-fragment\">Minute(Time() - 60, \"UTC+08:00\")<\/span><br \/>\nExpression: <span class=\"code-fragment\">Hour(Time(), \"Australia\/Perth\")<\/span><br \/>\nExpression: <span class=\"code-fragment\">Day(Time(), \"UTC+08:00\")<\/span><br \/>\nExpression: <span class=\"code-fragment\">Weekday(Time(), \"Australia\/Perth\")<\/span><br \/>\nExpression: <span class=\"code-fragment\">Month(Time(), \"UTC+08:00\")<\/span><br \/>\nExpression: <span class=\"code-fragment\">Year(Time(), \"UTC+08:00\")<\/span><\/p>\n<h2><span id=\"Release_History\">Release History<\/span><\/h2>\n<ul class=\"intro-text\">\n<li>Time Conversions 4.6.5\n<ul class=\"intro-text\">\n<li>Changed Time parameter to support MultiCollection values.<\/li>\n<\/ul>\n<\/li>\n<li>Time Conversions 4.0\n<ul class=\"intro-text\">\n<li>Initial version<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>IFS OI Server provides the following functions for converting a time (in seconds since 1970 UTC) into a requested component value: Second, Minute, Hour, Day, Weekday, Month, Year.<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/time-periods\/durations\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":10550,"parent":9756,"menu_order":9,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[9],"tags":[100,154],"class_list":["post-10271","page","type-page","status-publish","has-post-thumbnail","hentry","category-tech-ref","tag-calculations","tag-time","Version-4-0","Version-4-6-5","Product-srv"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/10271","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=10271"}],"version-history":[{"count":4,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/10271\/revisions"}],"predecessor-version":[{"id":67795,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/10271\/revisions\/67795"}],"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\/10550"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=10271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=10271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=10271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}