Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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

Great dreamer's dreams never fulfilled, they are always transcended.
Tags (2)
14 Replies

Re: date() vs timestamp()

True, they do not differ a lot, except that both functions default to different format strings if you omit the second parameter.

Re: date() vs timestamp()

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

Partner
Partner

Re: date() vs timestamp()

Hi,

Full understanding of Date is important for QV developers. I will advice to read the following blogs from HIC

The Date Function

Get the Dates Right

Automatic Number Interpretation

Re: date() vs timestamp()

Like it

Great dreamer's dreams never fulfilled, they are always transcended.

Re: date() vs timestamp()

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

Great dreamer's dreams never fulfilled, they are always transcended.
vvvvvvizard
Contributor III

Re: date() vs timestamp()

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

Re: date() vs timestamp()

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,

Great dreamer's dreams never fulfilled, they are always transcended.

Re: date() vs timestamp()

Hi,

AnyOne??

Sir hic and Sir mby

please comment on this.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.

Re: date() vs timestamp()

dreamer4

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