Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

juan_escobar
Contributor

Clock

Hello,

I'm trying to insert the date into my project. But I was wondering how can I add the system information (mm/dd/yyyy) or the IP information.

Thank you very much.

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: Clock

Try as expression in text box

='Todays date is: ' & Date(today(),'MM/DD/YYYY')

edit: and if you want a apostroph after today

='Today'&chr(39)&'s date is: '&date(today(),'MM/DD/YYY')

14 Replies
MVP
MVP

Clock

Hi Juan,

you could use today() function in an object, e.g. text box to display today's date.

With IP, you mean the network IP address, right?

I don't think that there is a system function for that, but search the help for all "system functions".

There is a ComputerName() function and you could query Registry entries or call system functions or use macros to retrieve more information from your system.

Hope that helps,

Stefan

erich_shiino
Honored Contributor

Clock

hi, Juan

Do you want to include it in the interface? I'm sure about the IP

But you could insert a text box with the following Expressions

=Date( today(), 'MM/DD/YYYY') => to get the system date

=now() => to create a clock (this can be a performance problem since the interface will be refreshed every second)

=osuser() => to get the user login (operational system login)

=qvuser() => to get the name of the user in the case of a section access using name/password

Hope this helps,

Erich

martinpohl
Valued Contributor II

Clock

for the date I would suggest now() for the system date and time.

For the IP I also don't know if it's possible.

Regards

juan_escobar
Contributor

Re: Clock

Ok, that worked fine. Now I want to add some text (strings) and in the middle of that insert the =Date(today(),'MM/DD/YYYY').

How can I do that? i.e: inside the text box: Today's date is: =Date(today(),'MM/DD/YYYY')

And also how can I modify the date format???

El mensaje fue editado por: Juan Escobar

MVP
MVP

Re: Clock

Try as expression in text box

='Todays date is: ' & Date(today(),'MM/DD/YYYY')

edit: and if you want a apostroph after today

='Today'&chr(39)&'s date is: '&date(today(),'MM/DD/YYY')

Highlighted
juan_escobar
Contributor

Re: Clock

That was awesome! now I want to separate the date from the clock? is it any way? like to say

='Today's date is: ' & Date(today(),'MM/DD/YYYY') and is it [the clock]

MVP
MVP

Re: Clock

You could use something like:

='Today'&chr(39)&'s date is: '&date(today(),'MM/DD/YYY')&' and it is '&time(now())

Please note that now() will refresh the clock permanently, decreasing system performance, consider using now(0) or now(2) instead.

Stefan

juan_escobar
Contributor

Re: Clock

Great! and if I want to change the time format from 24h to am/pm?

MVP
MVP

Clock

You could also specify a time format with time() similar to the date format with date(). Please look into format codes in the help file.

am/pm time format is specified with tt for example, like in

='Today'&chr(39)&'s date is: '&date(today(),'MM/DD/YYY')&' and it is '&time(now(),'hh:mm:ss tt')