{"id":1172,"date":"2019-10-03T13:23:00","date_gmt":"2019-10-03T12:23:00","guid":{"rendered":"https:\/\/microdata.spirehost.no\/?p=1172"},"modified":"2022-02-11T13:26:31","modified_gmt":"2022-02-11T12:26:31","slug":"new-functions-for-handling-of-date-values-available-in-microdata-no","status":"publish","type":"post","link":"https:\/\/www.microdata.no\/en\/new-functions-for-handling-of-date-values-available-in-microdata-no\/","title":{"rendered":"New functions for handling of date values available in microdata.no"},"content":{"rendered":"\n<p>Through microdata.no, it is possible to extract\/import and work with data on event format. This is the built-in raw format where each unit may be represented with several observations\/records associated with change events. <\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Each time a unit takes a new value for a given variable, this is represented as a new record containing the new value. Such datasets also have a set of start- and stop dates showing the start- and stop measurement for the new variable value.<\/p>\n\n\n\n<p>Eventdata may be extracted\/created by using the command\u00a0<code>import-event<\/code>. A specification of measurement time interval is required, and the dataset will as a result consist of all records overlapping or within the specified interval. In addition to the variable itself, the dataset will also contain the start- and stop dates for all records, represented by a start- and stop variable. The following name convention is used:\u00a0<br><code>START@&lt;variable name><\/code>\u00a0and\u00a0<code>STOP@&lt;variable name><\/code>.<\/p>\n\n\n\n<p>The values of the date variables assosiated with the event data are presented with a so-called reference format, i.e. numerical values specifying the number of days from 01.01.1970. This makes it trivial to compute durations (number of days), as it is not necessary to take varying number of days in months or leap years into consideration: duration = stop date &#8211; start date<\/p>\n\n\n\n<p>However, the reference format is not very intuitively in many situations. In order to solve this, a set of functions have been added which makes it possible to recalculate from reference values into year, month, week, weekday, quarter etc.<\/p>\n\n\n\n<p>The following new functions are now available for recalculation purposes (input parameter is the name of the variable containing the start- or stop dates):<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>year() &#8211; convert into year<\/li><li>month() &#8211; convert into month<\/li><li>day() &#8211; convert into day of month<\/li><li>dow() &#8211; convert into weekday (1-7, 1 = monday, 2 = tuesday etc)<\/li><li>doy() &#8211; convert into day of year (1-366)<\/li><li>week() &#8211; convert into week number<\/li><li>quarter() &#8211; convert into quarter<\/li><li>halfyear() &#8211; convert into halfyear<\/li><li>isoformatdate() &#8211; convert into date format YYYY-MM-DD (string)<\/li><\/ul>\n\n\n\n<p><a href=\"https:\/\/microdata.no\/brukermanual-en.pdf\">Click here for more details about the new date functions (go to Appendix B, page 104-107 in the User Guide)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Through microdata.no, it is possible to extract\/import and work with data on event format. This is the built-in raw format where each unit may be represented with several observations\/records associated with change events.<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[2],"tags":[],"class_list":["post-1172","post","type-post","status-publish","format-standard","hentry","category-news"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>New functions for handling of date values available in microdata.no - microdata.no<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.microdata.no\/en\/new-functions-for-handling-of-date-values-available-in-microdata-no\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New functions for handling of date values available in microdata.no - microdata.no\" \/>\n<meta property=\"og:description\" content=\"Through microdata.no, it is possible to extract\/import and work with data on event format. This is the built-in raw format where each unit may be represented with several observations\/records associated with change events.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microdata.no\/en\/new-functions-for-handling-of-date-values-available-in-microdata-no\/\" \/>\n<meta property=\"og:site_name\" content=\"microdata.no\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-03T12:23:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-11T12:26:31+00:00\" \/>\n<meta name=\"author\" content=\"Trond Pedersen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Trond Pedersen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/new-functions-for-handling-of-date-values-available-in-microdata-no\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/new-functions-for-handling-of-date-values-available-in-microdata-no\\\/\"},\"author\":{\"name\":\"Trond Pedersen\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#\\\/schema\\\/person\\\/76761ddfe0d06e3f08f5491a9faeab92\"},\"headline\":\"New functions for handling of date values available in microdata.no\",\"datePublished\":\"2019-10-03T12:23:00+00:00\",\"dateModified\":\"2022-02-11T12:26:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/new-functions-for-handling-of-date-values-available-in-microdata-no\\\/\"},\"wordCount\":362,\"articleSection\":[\"News\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/new-functions-for-handling-of-date-values-available-in-microdata-no\\\/\",\"url\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/new-functions-for-handling-of-date-values-available-in-microdata-no\\\/\",\"name\":\"New functions for handling of date values available in microdata.no - microdata.no\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#website\"},\"datePublished\":\"2019-10-03T12:23:00+00:00\",\"dateModified\":\"2022-02-11T12:26:31+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#\\\/schema\\\/person\\\/76761ddfe0d06e3f08f5491a9faeab92\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/new-functions-for-handling-of-date-values-available-in-microdata-no\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.microdata.no\\\/en\\\/new-functions-for-handling-of-date-values-available-in-microdata-no\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/new-functions-for-handling-of-date-values-available-in-microdata-no\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Hjem\",\"item\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"New functions for handling of date values available in microdata.no\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#website\",\"url\":\"https:\\\/\\\/www.microdata.no\\\/\",\"name\":\"microdata.no\",\"description\":\"Gj\u00f8r det enklere \u00e5 analysere registerdata\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.microdata.no\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#\\\/schema\\\/person\\\/76761ddfe0d06e3f08f5491a9faeab92\",\"name\":\"Trond Pedersen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b90e3f42c839e825d86949fc2f9a318f2a81da5f9e6b1431ff4d872333d4e717?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b90e3f42c839e825d86949fc2f9a318f2a81da5f9e6b1431ff4d872333d4e717?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b90e3f42c839e825d86949fc2f9a318f2a81da5f9e6b1431ff4d872333d4e717?s=96&d=mm&r=g\",\"caption\":\"Trond Pedersen\"},\"url\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/author\\\/trond\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"New functions for handling of date values available in microdata.no - microdata.no","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.microdata.no\/en\/new-functions-for-handling-of-date-values-available-in-microdata-no\/","og_locale":"en_US","og_type":"article","og_title":"New functions for handling of date values available in microdata.no - microdata.no","og_description":"Through microdata.no, it is possible to extract\/import and work with data on event format. This is the built-in raw format where each unit may be represented with several observations\/records associated with change events.","og_url":"https:\/\/www.microdata.no\/en\/new-functions-for-handling-of-date-values-available-in-microdata-no\/","og_site_name":"microdata.no","article_published_time":"2019-10-03T12:23:00+00:00","article_modified_time":"2022-02-11T12:26:31+00:00","author":"Trond Pedersen","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Trond Pedersen","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.microdata.no\/en\/new-functions-for-handling-of-date-values-available-in-microdata-no\/#article","isPartOf":{"@id":"https:\/\/www.microdata.no\/en\/new-functions-for-handling-of-date-values-available-in-microdata-no\/"},"author":{"name":"Trond Pedersen","@id":"https:\/\/www.microdata.no\/#\/schema\/person\/76761ddfe0d06e3f08f5491a9faeab92"},"headline":"New functions for handling of date values available in microdata.no","datePublished":"2019-10-03T12:23:00+00:00","dateModified":"2022-02-11T12:26:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.microdata.no\/en\/new-functions-for-handling-of-date-values-available-in-microdata-no\/"},"wordCount":362,"articleSection":["News"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.microdata.no\/en\/new-functions-for-handling-of-date-values-available-in-microdata-no\/","url":"https:\/\/www.microdata.no\/en\/new-functions-for-handling-of-date-values-available-in-microdata-no\/","name":"New functions for handling of date values available in microdata.no - microdata.no","isPartOf":{"@id":"https:\/\/www.microdata.no\/#website"},"datePublished":"2019-10-03T12:23:00+00:00","dateModified":"2022-02-11T12:26:31+00:00","author":{"@id":"https:\/\/www.microdata.no\/#\/schema\/person\/76761ddfe0d06e3f08f5491a9faeab92"},"breadcrumb":{"@id":"https:\/\/www.microdata.no\/en\/new-functions-for-handling-of-date-values-available-in-microdata-no\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microdata.no\/en\/new-functions-for-handling-of-date-values-available-in-microdata-no\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.microdata.no\/en\/new-functions-for-handling-of-date-values-available-in-microdata-no\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Hjem","item":"https:\/\/www.microdata.no\/en\/"},{"@type":"ListItem","position":2,"name":"New functions for handling of date values available in microdata.no"}]},{"@type":"WebSite","@id":"https:\/\/www.microdata.no\/#website","url":"https:\/\/www.microdata.no\/","name":"microdata.no","description":"Gj\u00f8r det enklere \u00e5 analysere registerdata","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.microdata.no\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.microdata.no\/#\/schema\/person\/76761ddfe0d06e3f08f5491a9faeab92","name":"Trond Pedersen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b90e3f42c839e825d86949fc2f9a318f2a81da5f9e6b1431ff4d872333d4e717?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b90e3f42c839e825d86949fc2f9a318f2a81da5f9e6b1431ff4d872333d4e717?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b90e3f42c839e825d86949fc2f9a318f2a81da5f9e6b1431ff4d872333d4e717?s=96&d=mm&r=g","caption":"Trond Pedersen"},"url":"https:\/\/www.microdata.no\/en\/author\/trond\/"}]}},"taxonomy_info":{"category":[{"value":2,"label":"News"}]},"featured_image_src_large":false,"author_info":{"display_name":"Trond Pedersen","author_link":"https:\/\/www.microdata.no\/en\/author\/trond\/"},"comment_info":0,"category_info":[{"term_id":2,"name":"News","slug":"news","term_group":0,"term_taxonomy_id":2,"taxonomy":"category","description":"","parent":0,"count":79,"filter":"raw","cat_ID":2,"category_count":79,"category_description":"","cat_name":"News","category_nicename":"news","category_parent":0}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/posts\/1172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/comments?post=1172"}],"version-history":[{"count":1,"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/posts\/1172\/revisions"}],"predecessor-version":[{"id":1173,"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/posts\/1172\/revisions\/1173"}],"wp:attachment":[{"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/media?parent=1172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/categories?post=1172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/tags?post=1172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}