

{"id":41828,"date":"2018-11-14T17:39:51","date_gmt":"2018-11-14T12:09:51","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=41828"},"modified":"2018-11-14T17:39:51","modified_gmt":"2018-11-14T12:09:51","slug":"qlik-sense-date-and-time-functions","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/","title":{"rendered":"Qlik Sense Date and Time Functions &#8211; Syntax and Example"},"content":{"rendered":"<h2><span style=\"font-weight: 400\">1. Objective<\/span><\/h2>\n<p><span style=\"font-weight: 400\">In our last Qlik Sense tutorial, we discussed <strong><a href=\"https:\/\/data-flair.training\/blogs\/qlik-sense-integer-functions\/\">Qlik Sense Integer Functions<\/a><\/strong>. Today, we will see Qlik Sense Date and Time Functions. We use the date and time functions in Qlik Sense to process and evaluate the date and time data values present in the data records. Basically, we use these functions both in the script and chart expressions. Each time and date value since December 30, 1899 has a unique serial number (i.e. number of days from December 30,1899) whose integer part represents the day and fractional value represents the time of that day. So, when Qlik Sense evaluates these functions, the date and time values are taken up as numerical values.<\/span><\/p>\n<p>So, let&#8217;s start Qlik Sense Date and Time Functions.<\/p>\n<div id=\"attachment_41845\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-41845\" class=\"size-full wp-image-41845\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01.jpg\" alt=\"Qlik Sense Date and Time Functions\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-41845\" class=\"wp-caption-text\">Qlik Sense Date and Time Functions &#8211; Syntax and Example<\/p><\/div>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/qlik-sense-mathematical-functions\/\">Have a look at Qlik Sense Mathematical functions\u00a0<\/a><\/strong><\/p>\n<h2>2. Qlik Sense Date and Time Functions<\/h2>\n<p>Following are the Qlik Sense Date and Time Functions, let&#8217;s discuss them in detail &#8211;<\/p>\n<h3><span style=\"font-weight: 400\">i. Timestamp functions<\/span><\/h3>\n<p><span style=\"font-weight: 400\">These functions return timestamps in specific situations. <\/span><\/p>\n<h4><span style=\"font-weight: 400\">a. Now() function<\/span><\/h4>\n<p><span style=\"font-weight: 400\">The Now() function returns the current time as a timestamp from the system\u2019s clock. This function returns value in dual data type. <\/span><\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">now([timer_mode])<\/pre>\n<p><span style=\"font-weight: 400\">Where the <\/span><span style=\"font-weight: 400\">timer_mode<\/span><span style=\"font-weight: 400\"> can assume three values, i.e. 0 (returns the time of last completion of data load), 1 (returns the time of a function call) and 2 (returns the time when the app was opened). The default value is set at 1.<\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>For example,<\/strong> <\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">now( 0)<\/span><span style=\"font-weight: 400\"> will return the time when the last data load completed.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">now( 1)<\/span><span style=\"font-weight: 400\"> will return the time of the function call. If and when you use this function in a current load script, then it returns the current time of a function called within that data load. <\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">now( 2)<\/span><span style=\"font-weight: 400\"> will return the time when the app was opened.<\/span><\/li>\n<\/ul>\n<h4><span style=\"font-weight: 400\">b. Today() function <\/span><\/h4>\n<p><span style=\"font-weight: 400\">The today() function returns the current date in the timestamp from the system\u2019s clock. This function returns the value in dual data type.<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/qlik-sense-null-functions\/\">Do you know about Qlik Sense Null Functions<\/a><\/strong><\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">today([timer_mode])<\/pre>\n<p><span style=\"font-weight: 400\">Where the timer_mode can assume three values, i.e. 0 (returns the time of last completion of data load), 1 (returns the time of a function call) and 2 (returns the time when the app was opened). The default value is set at 1.<\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>For example,<\/strong> <\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">today(0)<\/span><span style=\"font-weight: 400\"> will return the day when the last data load completed.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">today(1)<\/span><span style=\"font-weight: 400\"> will return the day of the function call. If and when you use this function in a current load script, then it returns the current day of a function called within that data load. <\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">today(2)<\/span><span style=\"font-weight: 400\"> will return the day when the app was opened.<\/span><\/li>\n<\/ul>\n<h4><span style=\"font-weight: 400\">c. Localtime() function <\/span><\/h4>\n<p><span style=\"font-weight: 400\">This function returns the current time as a timestamp according to a specific time zone or the local time zone of the system\u2019s clock. <\/span><\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">localtime([timezone [, ignoreDST ]])<\/pre>\n<p><span style=\"font-weight: 400\">Where, through <\/span><span style=\"font-weight: 400\">timezone<\/span><span style=\"font-weight: 400\"> the place of the timezone is specified in strings e.g. \u2018Paris\u2019 or as in the \u2018GMT+hh:mm\u2019 notation. <\/span><\/p>\n<p><span style=\"font-weight: 400\">By setting <\/span><span style=\"font-weight: 400\">ignoreDST<\/span><span style=\"font-weight: 400\"> as -1 i.e. True, the daylight savings time adjustment will be ignored. <\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>For example,<\/strong> <\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">localtime()<\/span><span style=\"font-weight: 400\"> will return the local time 2017-10-22 12:54:47 (according to your system\u2019s clock).<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">localtime(&#8216;London&#8217;)<\/span><span style=\"font-weight: 400\"> will returns the local time in London like 2017-10-22 11:54:47.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">localtime(&#8216;GMT+02:00&#8217;)<\/span><span style=\"font-weight: 400\"> will return the local time in the timezone of GMT+02:00 like 2017-10-22 13:54:47.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">localtime(&#8216;Paris&#8217;,&#8217;-1&#8242;)<\/span><span style=\"font-weight: 400\"> will return the local time in Paris with daylight savings time ignored like, 2017-10-22 11:54:47.<\/span><\/li>\n<\/ul>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/box-plot-in-qlik-sense\/\">Let&#8217;s learn more about Qlik Sense Box Plot<\/a><\/strong><\/p>\n<h3><span style=\"font-weight: 400\">ii. Make functions<\/span><\/h3>\n<p><span style=\"font-weight: 400\">The make functions make a date, week dates or time according to the provided parameters. <\/span><\/p>\n<h4><span style=\"font-weight: 400\">a. Makedate() function<\/span><\/h4>\n<p><span style=\"font-weight: 400\">This function makes a date out of the given year, month and day parameters as YYYY, MM, DD respectively. <\/span><\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">makedate(YYYY [ , MM [ , DD ]])<\/pre>\n<p><span style=\"font-weight: 400\"><strong>For example,<\/strong> <\/span><\/p>\n<p><span style=\"font-weight: 400\">Makedate(2018,10,6)<\/span><\/p>\n<p><span style=\"font-weight: 400\">Returns the date 2018-10-06.<\/span><\/p>\n<h4><span style=\"font-weight: 400\">b. Makeweekdate() function<\/span><\/h4>\n<p><span style=\"font-weight: 400\">This function returns the date from the given week information such as <\/span><span style=\"font-weight: 400\">YYYY<\/span><span style=\"font-weight: 400\"> (year), <\/span><span style=\"font-weight: 400\">WW<\/span><span style=\"font-weight: 400\"> (number of week) and <\/span><span style=\"font-weight: 400\">D<\/span><span style=\"font-weight: 400\"> (day of the week, where 0 is assumed as Monday) as parameters. <\/span><\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">makeweekdate(YYYY[, WW[, D]])<\/pre>\n<p><span style=\"font-weight: 400\"><strong>For example,<\/strong> <\/span><\/p>\n<p><span style=\"font-weight: 400\">makeweekdate(2014,6,6)<\/span><span style=\"font-weight: 400\"> will return 2014-02-09.<\/span><\/p>\n<p><span style=\"font-weight: 400\">makeweekdate(2014,6)<\/span><span style=\"font-weight: 400\"> will return 2014-02-03 as weekday is assumed as 0 (Monday).<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/qlik-sense-scatter-plot\/\">Know more about Qlik Sense\u00a0Scatter Plot<\/a><\/strong><\/p>\n<h4><span style=\"font-weight: 400\">c. Maketime() function <\/span><\/h4>\n<p><span style=\"font-weight: 400\">This function creates a date from the given parameters such as <\/span><span style=\"font-weight: 400\">hh<\/span><span style=\"font-weight: 400\"> (hours), <\/span><span style=\"font-weight: 400\">mm<\/span><span style=\"font-weight: 400\"> (minutes) and <\/span><span style=\"font-weight: 400\">ss<\/span><span style=\"font-weight: 400\"> (seconds). If you mention no minute or second value in specific, then it is assumed to be 00. <\/span><\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">MakeTime(hh[,mm[,ss]])<\/pre>\n<p><span style=\"font-weight: 400\"><strong>For example,<\/strong> <\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">maketime(20)<\/span><span style=\"font-weight: 400\"> will return the time as 22:00:00<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">maketime(20,15)<\/span><span style=\"font-weight: 400\"> will return the time as 20:15:00<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">maketime(20,15,30)<\/span><span style=\"font-weight: 400\"> will return the time as 20:15:30<\/span><\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400\">iii. Set Time Functions<\/span><\/h3>\n<h4><span style=\"font-weight: 400\">a. Setdateyear() function <\/span><\/h4>\n<p><span style=\"font-weight: 400\">The setdateyear function returns an updated year by taking a timestamp and a specific year as parameters of the function. This function returns a dual data type. <\/span><\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">setdateyear(timestamp, year)<\/pre>\n<p><span style=\"font-weight: 400\">Where <\/span><span style=\"font-weight: 400\">timestamp<\/span><span style=\"font-weight: 400\"> is the date and <\/span><span style=\"font-weight: 400\">year<\/span><span style=\"font-weight: 400\"> a four-digit year entered by you. <\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>For example,<\/strong> <\/span><\/p>\n<p><span style=\"font-weight: 400\">You want to update a list of dates to that of the current year. <\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SetYear:\r\nLoad *,\r\nSetDateYear(testdates, 2018) as NewYear\r\nInline [\r\nTestdates\r\n1\/5\/2017\r\n2\/1\/2017\r\n19\/5\/2017\r\n15\/9\/2017\r\n11\/12\/2017\r\n2\/3\/2017\r\n14\/5\/2017\r\n13\/6\/2017\r\n7\/7\/2017\r\n4\/8\/2017\r\n];\r\n<\/pre>\n<p>In the resultant table, the year 2017 will be changed to 2018.<\/p>\n<table style=\"height: 649px\" width=\"171\">\n<tbody>\n<tr>\n<td><b>Testdates<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">1\/5\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">2\/1\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">19\/5\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">15\/9\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">11\/12\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">2\/3\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">14\/5\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">13\/6\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">7\/7\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">4\/8\/2018<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4><span style=\"font-weight: 400\">b. Setdateyearmonth() function <\/span><\/h4>\n<p><span style=\"font-weight: 400\">This function updates the year and month of a date in a timestamp. This function returns a value of dual data format.<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/qlik-sense-color-functions\/\">Let&#8217;s discuss Qlik Sense Color Functions<\/a><\/strong><\/p>\n<p><strong>Syntax<\/strong><span style=\"font-weight: 400\">:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">setdateyearmonth(timestamp, year, month)<\/pre>\n<p><span style=\"font-weight: 400\"><strong>For example,<\/strong> <\/span><\/p>\n<p><span style=\"font-weight: 400\">we load the following dates and update both, the date and month of them. <\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">SetYearMonth:\r\nLoad *,\r\nSetDateYearMonth(testdates, 2018,2) as NewYearMonth\r\nInline [\r\nTestdates\r\n2\/1\/2017\r\n19\/5\/2017\r\n15\/9\/2017\r\n11\/12\/2017\r\n14\/5\/2017\r\n13\/6\/2017\r\n7\/7\/2017\r\n4\/8\/2017\r\n];<\/pre>\n<p>The resultant table will have dates with updated months and years.<\/p>\n<table style=\"height: 531px\" width=\"192\">\n<tbody>\n<tr>\n<td><b>Testdates<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">2\/2\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">19\/2\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">15\/2\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">11\/12\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">14\/2\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">13\/6\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">7\/7\/2018<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">4\/8\/2018<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span style=\"font-weight: 400\">iv. Other date functions<\/span><\/h3>\n<h4><span style=\"font-weight: 400\">a. Addmonths() function <\/span><\/h4>\n<p><span style=\"font-weight: 400\">This function returns a date which will occur <\/span><b>n<\/b><span style=\"font-weight: 400\"> months before (if n is negative) or after (if n is positive) the mentioned <\/span><b>startdate<\/b><span style=\"font-weight: 400\">. This function returns a data in dual format. <\/span><\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">addmonths(startdate, n ,[,mode])<\/pre>\n<p><span style=\"font-weight: 400\"><strong>For example,<\/strong> <\/span><\/p>\n<p><span style=\"font-weight: 400\">ddmonths(&#8216;2017-06-29&#8217;,3)<\/span><span style=\"font-weight: 400\"> will return &#8216;2017-09-29&#8217; as the date for 3 months later of the start date.<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/qlik-sense-counter-functions\/\">Have a look at Qlik Sense Counter Functions<\/a><\/strong><\/p>\n<h4><span style=\"font-weight: 400\">b. Addyears() function<\/span><\/h4>\n<p><span style=\"font-weight: 400\">This function returns a date where n number of years has been added to the startdate. If n is positive then, n years after the startdate are added and if n is negative, then n years before the start date is added to the current date.<\/span><\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">AddYears(startdate, n)<\/pre>\n<p><strong>For example<\/strong><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">addyears(&#8216;2010-01-29&#8217;,3)<\/span><span style=\"font-weight: 400\"> will return the date &#8216;2013-01-29&#8217;<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">addyears(&#8216;2010-01-29&#8217;,-1)<\/span><span style=\"font-weight: 400\"> will return the date &#8216;2009-01-29&#8217;<\/span><\/li>\n<\/ul>\n<h4><span style=\"font-weight: 400\">c. Yeartodate() function <\/span><\/h4>\n<p><span style=\"font-weight: 400\">This function returns a Boolean value (True or False) for whether the year mentioned in the function falls on the same year as recorded in the date of the timestamp for when script was last loaded. <\/span><\/p>\n<p><strong>Syntax<\/strong><span style=\"font-weight: 400\"><strong>:<\/strong> <\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">YearToDate(timestamp[,yearoffset[, firstmonth [,todaydate]] ])<\/pre>\n<p><span style=\"font-weight: 400\">Where the <\/span><span style=\"font-weight: 400\">timestamp<\/span><span style=\"font-weight: 400\"> is the date that this function will evaluate. <\/span><\/p>\n<p><span style=\"font-weight: 400\">By <\/span><span style=\"font-weight: 400\">yearoffset<\/span><span style=\"font-weight: 400\"> the function evaluates the presence of same period in some other year than what is mentioned in the timestamp. If the value of this parameter is negative, then the function will look for the pervious year\u2019s date and if it is positive, then the next year\u2019s date. If you do not specify this parameter, then it is considered to be 0.<\/span><\/p>\n<p><span style=\"font-weight: 400\">firstmonth<\/span><span style=\"font-weight: 400\"> parameter specifies a month by the value 1 to 12 which decides from which month a year must start. For instance, you set this parameter to 5 if you want the year to start from May1<\/span><span style=\"font-weight: 400\">st<\/span><span style=\"font-weight: 400\"> which is a fiscal year. <\/span><\/p>\n<p><span style=\"font-weight: 400\">todaydate<\/span><span style=\"font-weight: 400\"> sets the first day of a month. <\/span><\/p>\n<p><strong>For example,<\/strong><\/p>\n<p><span style=\"font-weight: 400\">If the last script reload time was \u20182018-10-30\u2019<\/span><\/p>\n<p><span style=\"font-weight: 400\">Then the function will return, <\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">yeartodate(\u20182017-10-30\u2019)<\/span><span style=\"font-weight: 400\"> \u00a0returns False.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">yeartodate(\u20182018-09-12\u2019)<\/span><span style=\"font-weight: 400\"> returns True because the years match<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">yeartodate(.2017-10-30\u2019, 1)<\/span><span style=\"font-weight: 400\"> returns True because the year offset is set at 1 which gives the year to follow i.e. 2018 in this case.<\/span><\/li>\n<\/ul>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/qlik-sense-logical-functions\/\">Let&#8217;s learn more about Qlik Sense Logical Functions<\/a><\/strong><\/p>\n<p>So, this was all in Qlik Sense Date and Time Functions. Hope you like our explanation.<\/p>\n<h2><span style=\"font-weight: 400\">3. Conclusion <\/span><\/h2>\n<p><span style=\"font-weight: 400\">Hence, in this Qlik Sense Date and Time Functions Tutorial, we discussed all the important date and time function that we use to handle and work with dates and time in your data which is a very crucial information for the proper functioning of any enterprise.<\/span><\/p>\n<p>Still, if you have any query regarding Qlik Sense Date and Time Functions ask in the comment tab.<\/p>\n<p><strong>See also &#8211;\u00a0<\/strong><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/treemap-visualization\/\">Treemap Visualization in Qlik Sense\u00a0<\/a><\/strong><\/p>\n<p><strong><a href=\"https:\/\/www.qlik.com\/us\/try-or-buy\/download-qlik-sense\">Reference for Qlik Sense<\/a><\/strong><span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:1714,&quot;href&quot;:&quot;https:\\\/\\\/www.qlik.com\\\/us\\\/try-or-buy\\\/download-qlik-sense&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Objective In our last Qlik Sense tutorial, we discussed Qlik Sense Integer Functions. Today, we will see Qlik Sense Date and Time Functions. We use the date and time functions in Qlik Sense&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":41845,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17408],"tags":[17647,17648,17649],"class_list":["post-41828","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-qlik-sense-tutorials","tag-qlik-sense-date-and-time-fucntions","tag-qlik-sense-date-functions","tag-qlik-sense-time-fucntions"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Qlik Sense Date and Time Functions - Syntax and Example - DataFlair<\/title>\n<meta name=\"description\" content=\"Qlik Sense Date and Time Functions,Timestamp,Make Functions,Set Time Functions,Addyears Function,Now Function,Today Function syntax, Example\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Qlik Sense Date and Time Functions - Syntax and Example - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Qlik Sense Date and Time Functions,Timestamp,Make Functions,Set Time Functions,Addyears Function,Now Function,Today Function syntax, Example\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-14T12:09:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Qlik Sense Date and Time Functions - Syntax and Example - DataFlair","description":"Qlik Sense Date and Time Functions,Timestamp,Make Functions,Set Time Functions,Addyears Function,Now Function,Today Function syntax, Example","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:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/","og_locale":"en_US","og_type":"article","og_title":"Qlik Sense Date and Time Functions - Syntax and Example - DataFlair","og_description":"Qlik Sense Date and Time Functions,Timestamp,Make Functions,Set Time Functions,Addyears Function,Now Function,Today Function syntax, Example","og_url":"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-11-14T12:09:51+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"Qlik Sense Date and Time Functions &#8211; Syntax and Example","datePublished":"2018-11-14T12:09:51+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/"},"wordCount":1347,"commentCount":1,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01.jpg","keywords":["Qlik Sense date and Time Fucntions","Qlik Sense Date Functions","Qlik Sense Time Fucntions"],"articleSection":["Qlik Sense Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/","url":"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/","name":"Qlik Sense Date and Time Functions - Syntax and Example - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01.jpg","datePublished":"2018-11-14T12:09:51+00:00","description":"Qlik Sense Date and Time Functions,Timestamp,Make Functions,Set Time Functions,Addyears Function,Now Function,Today Function syntax, Example","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/11\/Qlik-Sense-Date-and-Time-Functions-01.jpg","width":1200,"height":628,"caption":"Qlik Sense Date and Time Functions - Syntax and Example"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/qlik-sense-date-and-time-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Qlik Sense Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/qlik-sense-tutorials\/"},{"@type":"ListItem","position":3,"name":"Qlik Sense Date and Time Functions &#8211; Syntax and Example"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/41828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=41828"}],"version-history":[{"count":3,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/41828\/revisions"}],"predecessor-version":[{"id":42064,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/41828\/revisions\/42064"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/41845"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=41828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=41828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=41828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}