{"id":1618,"date":"2020-08-24T09:38:40","date_gmt":"2020-08-24T07:38:40","guid":{"rendered":"http:\/\/www.hunggartorino.it\/ql\/?p=1618"},"modified":"2020-08-24T09:39:46","modified_gmt":"2020-08-24T07:39:46","slug":"date-and-date","status":"publish","type":"post","link":"http:\/\/www.hunggartorino.it\/ql\/date-and-date\/","title":{"rendered":"DATE$and DATE"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">SuperBasic can use the environment variable DATE$, which contains the system date and time in the following format:<br>1991 May 06 18:18:44<br>This value can be used as a string or be used for date manipulation.<br>It is possbile to pass an integer value to this variable, containing the number of seconds to be added to the initial date (1\/1\/1961).<br>PRINT DATE$(0) e.g. will return<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1961 Jan 01 00:00:00,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">while PRINT DATE$(10) will return<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1961 Jan 01 00:00:10.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This means that if you want, for example, to use an interval of a few days you will have to use a multiple of 86400 (the number of seconds in a day).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is possible to use the TO function on the string returned by DATE$. As an example, you can achieve the stored year by using<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">YEAR = DATE$ (1 TO 4)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another environment variable, called DATE, returns an integer value containing the number of seconds passed since 1961 January 1: this means that DATE$(DATE) will return the current date.<br>Using this variable we can calculate time intervals (e.g. every day would be 86400 seconds long) without having to care for the days in a month, bisextile years, or the like.<br>Another way to use DATE is to pass this variable a 6 values array, which can be used as a system date. Passing, for example, this<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">DATE(2029,1,19,3,14,7)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">these values will be treated as a system date, without having to convert it in seconds since 1961\/1\/1. In this case, we are showing the maximum date value allowed on the QL: January 19, 2029, h3:14 and 7 seconds. From then on, the clock will restart from January 1, 1961.<\/p>\n","protected":false},"excerpt":{"rendered":"SuperBasic can use the environment variable DATE$, which contains the system date and time in the following format:1991 May 06 18:18:44This value can \n<a class=\"moretag\" href=\"http:\/\/www.hunggartorino.it\/ql\/date-and-date\/\"> [..more...]<\/a>","protected":false},"author":3,"featured_media":1615,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-1618","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming"],"_links":{"self":[{"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/posts\/1618","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/comments?post=1618"}],"version-history":[{"count":2,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/posts\/1618\/revisions"}],"predecessor-version":[{"id":1620,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/posts\/1618\/revisions\/1620"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/media\/1615"}],"wp:attachment":[{"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/media?parent=1618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/categories?post=1618"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/tags?post=1618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}