
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
date() vs timestamp()
Dear All,
I have read so many document about date() and timestamp()
but did not get it why we required this 2 function independently.
The reason behind asking this question is we can perfom date and time formating with date() as well as timestamp() also.
So why 2 different function available???
Which one is most preferable??
Please share knowledge
Regards
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're right that both are doing the same thing. The following two calls return the same values:
Date(Time,'YYYY-MM-DD hh:mm'),
Timestamp(Time,'YYYY-MM-DD hh:mm'),
The only difference is in the defaults. The reason why it is the way it is, is mostly historical.
HIC

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
True, they do not differ a lot, except that both functions default to different format strings if you omit the second parameter.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, forgot about the second part of your question. I do not have a preference except that typing date takes less time (! there you have the third sister-function) than typing timestamp
Best,
Peter

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Full understanding of Date is important for QV developers. I will advice to read the following blogs from HIC

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Like it
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
thanks for reply.
I have already read this article but did not get the reason why 2 independent function availble in qlikview even if both perform same thing????????
Thanks again.
Regards
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
when using the date function on a timestamp you may not always get the desired output in calculations , use the timestamp when the date has a time with it eg 01/09/2015 17:23:12 and date for just dates without time

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I dont think so the formatting is happening beacuse of date() and timestamp()
It is happening because you setting format in in load script
check your
dateFormat
and TimestampFormat in script.
Regards,
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're right that both are doing the same thing. The following two calls return the same values:
Date(Time,'YYYY-MM-DD hh:mm'),
Timestamp(Time,'YYYY-MM-DD hh:mm'),
The only difference is in the defaults. The reason why it is the way it is, is mostly historical.
HIC

- « Previous Replies
-
- 1
- 2
- Next Replies »