Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
GB5256
Contributor II
Contributor II

To get LocalTime stamp to work in Qlik SaaS PixelPerfect Report

I am using Qlik Sense as a SaaS and trying to create a PixelPerfect Report online (not via Excel Plugin).
But I am struggeling to get LocalDateTimeNow()  to display the local date of the user.

My User Profile shows that I am CET plus 1, but the LocalDateTimeNow() always returns CET (Standard time in this case as it is the same).

If this is not working like that, then what does LocalDateTimeNow() actually mean compared to now() ?

 

GB

Labels (3)
9 Replies
mpc
Partner Ambassador
Partner Ambassador

Hi,

Now() returns the Timestamp regarding the System settings. 
LocalTime() returns the Timestamp for a specific region, which is a parameter of the function. 

Does the Now() function in Qlik Sense (not the Pixel Perfect report) return the correct time (CET+1) or not ? 

Best

From Next Decision and mpc with love
GB5256
Contributor II
Contributor II
Author

HI,

Now() in Sense  does not show CET+1.

Frank_S
Support
Support

@Ruggero_Piccoli 

Can you suggest here?

Thanks in advance...

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Ruggero_Piccoli
Support
Support

Hi,

Date and Time funciotn of Qlik Sense Cloud are documented in the help site page https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFun... and I'm not able to find LocalDateTimeNow(). You can use now() to retrieve the timestamp of the Qlik Sense server or use LocalTime() https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFun... that allows you to specify the time zone.

To get the format you want I suggest to use Qlik Sense formatting functions. For example FormatString('{0:dd/MM/yyyy}', AddDays(#1899-12-30#, [Date]))

In case you do not use section access, only one report will be created for every group of filters so there could be users in different time zones receiving the same report. 

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
GB5256
Contributor II
Contributor II
Author

Hi,

see screenshot below about LocalDateTimeNow(). It is a standard function.

It seems to me that there are quite fundamental differences between the "normal" expression editor, and the one in the PixelPerfect area.

Screenshot 2025-02-06 161951.png

But perhaps lets forget about the way I wanted to do it. What I need to achieve is that the report created shows our CET plus 1 time. How do I do that? And Bonus Question: Not in the expression editor in the sheets, but in the expression editor in Pixel Perfect.

Frank_S
Support
Support

@Ruggero_Piccoli 

I see where you are going.

I am able to get 12 am Feb. 6, 2025 every time with LocalDateTimeToday() within function editor for for the label shown below. So this function LocalDateTimeToday() doesn't seem to work.

Frank_S_0-1738885521114.png

However, UTCNow() works as shown below but cannot do -8 to set to local PST. It goes blank when inserting -8 ie: UTCNow()-8 or UTCNow(()-8)

Now() doesnt work at all.

Frank_S_1-1738885907102.png

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
GB5256
Contributor II
Contributor II
Author

@Ruggero_Piccoli Any Suggestions now how to get a local timestamp in PixelPerfect?

Thanks,

gb

Frank_S
Support
Support

I suspect the feature is not available so not working as hoped.

Please submit the requirement here in our ideation feature request site.

Ideation Suggest a Feature

In the meantime you can use Ruggero's suggestion.

Here is an example of one I use in Qlik Sense Cloud.

Add a text or image and text box or chart object to your Qlik App and use this in the formula editor. (name the object so you will recognized from the PxP editor.

ConvertToLocalTime(UTC(), 'GMT-08:00')' 

*Keep in mind that the above is PST. Adjust it accordingly.

Use the 'add image' feature to add the new object to your PxP report

 

As you can see below, the result is as expected. Local time 1:20 pm PST (top right of the report output.

 

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Ruggero_Piccoli
Support
Support

Hi,

1 - Create a variable in Qlik Sense app called, for example, vUserTimeZone and set the default value to 0

2 - Create filters in reporting to set the value of the variable. For example UTZ 10 to add 10 hours to the server time zone to calculate the one of the user. I suppose the server is set to UTC. It is possible to use filters to set the value of variables. 

Ruggero_Piccoli_0-1739961239503.png

3 - Assign the correct filter to each recipient in the Excel file you use to import them

4 - Create a PixelPerfect template and add an expressio with the formula =Text(Timestamp(Timestamp('1899-12-30') + (Now(1) + vUserTimeZone/24), 'DD/MM/YYYY HH:mm')) The now(1) returns the server date and time and it adds the variable value vUserTimeZone/24 divided by 24 to calculate the hours. The formula applies also the formatting rules that you prefer.

5 - Insert the formula in the template, create a task and distribute the reports to the users: each will receive the calculated field customized for the associated value of the variable. 

Best Reagrds,

Ruggero

 



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.