{"id":28181,"date":"2017-06-16T09:57:05","date_gmt":"2017-06-16T01:57:05","guid":{"rendered":"http:\/\/localhost\/help\/?page_id=28181"},"modified":"2024-01-17T10:48:01","modified_gmt":"2024-01-17T02:48:01","slug":"duration","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/duration\/","title":{"rendered":"Duration()"},"content":{"rendered":"\n<h2><span id=\"Format\">Format<\/span><\/h2>\n<p class=\"intro-text\"><strong>Duration(Arg1 [,FormatString])<\/strong><\/p>\n<h2><span id=\"Returns\">Returns<\/span><\/h2>\n<p class=\"intro-text\">Converts the supplied argument into a Duration data type. Duration is expressed in <em>seconds<\/em>.<\/p>\n<h2>Inputs<\/h2>\n<p class=\"intro-text\"><strong>Arg1<\/strong>: The argument to be converted into a duration.<br \/>\nBehaviour:\u00a0Required<br \/>\nDimension: Collection, SingleValue, MultiCollection<br \/>\nValid data types: Decimal, Integer, String, Duration<\/p>\n<p class=\"intro-text\"><b>FormatString<\/b>: The string specifying the format of the first argument, if it is a string. Applies only if the first argument is a string.\u00a0<br \/>\nBehaviour: Optional<br \/>\nDimensions: 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=\"Format_Codes\">Format Codes<\/span><\/h2>\n<p class=\"intro-text\">The following codes within the FormatString are replaced with the relevant information.\u00a0The codes are not case sensitive.<\/p>\n<ul>\n<li class=\"intro-text\">The codes must be in quotation marks. E.g. \"Day\"<\/li>\n<li class=\"intro-text\">You may concatenate the codes to produce the desired string. E.g. \"DayMonth\"<\/li>\n<li class=\"intro-text\">You may include other text, spaces, and punctuation within the quotation marks. E.g. \"Day, Month\"<\/li>\n<li class=\"intro-text\">Any other text within the quotation marks\u00a0is converted to upper case.<\/li>\n<\/ul>\n<table>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>DDD<\/strong><\/td>\n<td width=\"373\">Day of year (001 to 366)<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>DAY<\/strong><\/td>\n<td width=\"373\">Full weekday name<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>DY<\/strong><\/td>\n<td width=\"373\">Abbreviated weekday name, e.g. FRI<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>MONTH<\/strong><\/td>\n<td width=\"373\">Full month name<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>MON<\/strong><\/td>\n<td width=\"373\">Abbreviated month name, e.g. AUG<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>HH<\/strong><\/td>\n<td width=\"373\">Hour in 12 hour format (1 - 12)<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>YYYY<\/strong><\/td>\n<td width=\"373\">Four-digit year<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>A.M.<\/strong><\/td>\n<td width=\"373\">AM or PM indicator<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>AM<\/strong><\/td>\n<td width=\"373\">AM or PM indicator<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>P.M.<\/strong><\/td>\n<td width=\"373\">AM or PM indicator<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>PM<\/strong><\/td>\n<td width=\"373\">AM or PM indicator<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>WW<\/strong><\/td>\n<td width=\"373\">Week of year, if Sunday is the first day of the week<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>IW<\/strong><\/td>\n<td width=\"373\">Week of year, if Monday is the first day of the week<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>DD<\/strong><\/td>\n<td width=\"373\">Day of month (01 to 31)<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>MM<\/strong><\/td>\n<td width=\"373\">Month (01 to 12)<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>MI<\/strong><\/td>\n<td width=\"373\">Minutes (00 to 59)<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>SS<\/strong><\/td>\n<td width=\"373\">Seconds (00 to 59)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>D<\/strong><\/td>\n<td width=\"373\">Day of week<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>IY<\/strong><\/td>\n<td width=\"373\">Two-digit year (00 to 99)<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>YY<\/strong><\/td>\n<td width=\"373\">Two-digit year (00 to 99)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"intro-text\">The following additional custom codes also apply:<\/p>\n<table>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>D<\/strong><\/td>\n<td width=\"373\">Day of month (01 to 31)<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>hh<\/strong><\/td>\n<td width=\"373\">Hour in 12 hour format (1 - 12)<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>mm<\/strong><\/td>\n<td width=\"373\">Minutes (00 to 59)<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"81\"><strong>ss<\/strong><\/td>\n<td width=\"373\">Seconds (00 to 59)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span id=\"Examples\">Examples<\/span><\/h2>\n<p class=\"intro-text\">Expression: Duration<span class=\"code-fragment\">(12)<\/span><br \/>\nResult: Returns the integer value of <em>12<\/em>\u00a0as a duration of 12 seconds. <br \/>\nE.g. <span style=\"color: #0000ff;\">00:00:12.000<\/span><\/p>\n<p class=\"intro-text\">Expression: Duration<span class=\"code-fragment\">(12.2)<\/span><br \/>\nResult: Returns the decimal value of <em>12.2<\/em>\u00a0as a duration of 12 seconds and 200 milliseconds. <br \/>\nE.g. <span style=\"color: #0000ff;\">00:00:12.200 <\/span><\/p>\n<p class=\"intro-text\">Expression: Duration<span class=\"code-fragment\">(\"01:02:03\", \"HH:MI:SS\")<\/span><br \/>\nResult: Returns the string <em>\"01:02:03\"<\/em>\u00a0as\u00a0a duration of 1 hour 2 minutes and 3 seconds. <br \/>\nE.g. <span style=\"color: #0000ff;\">01:02:03<\/span><\/p>\n<p class=\"intro-text\">Expression: Duration<span class=\"code-fragment\">({du'01:00'}, \"HH:MI:SS\")<\/span><br \/>\nResult: Format the supplied duration in the specified format. <br \/>\nE.g.\u00a0<span style=\"color: #0000ff;\">01:00:00<\/span><\/p>\n<h2><span id=\"Release_History\">Release History<\/span><\/h2>\n<ul class=\"intro-text\">\n<li>Duration() 4.6.5\n<ul class=\"intro-text\">\n<li>Changed Arg1 parameter to support MultiCollection values.<\/li>\n<\/ul>\n<\/li>\n<li>Duration() 4.0\n<ul class=\"intro-text\">\n<li>Initial version<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Converts the supplied argument into a Duration data type.<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/duration\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":10466,"parent":3650,"menu_order":98,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[9],"tags":[100,397],"class_list":["post-28181","page","type-page","status-publish","has-post-thumbnail","hentry","category-tech-ref","tag-calculations","tag-casting-functions","Version-4-0","Version-4-6-5","Product-srv"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/28181","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=28181"}],"version-history":[{"count":3,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/28181\/revisions"}],"predecessor-version":[{"id":64730,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/28181\/revisions\/64730"}],"up":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/3650"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=28181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=28181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=28181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}