Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

omarbensalem
Esteemed Contributor

Timestamp format ("2017-12-21T13:33:25.494Z")

Hi all,

Does anybody know how to write such a timestamp format in Qlik?

"2017-12-21T13:33:25.494Z"

with the T and Z?

5 Replies
sureshqv
Esteemed Contributor III

Re: Timestamp format ("2017-12-21T13:33:25.494Z")

hi,

the timestamp you got from by web service?

read below :

The T doesn't really stand for anything. It is just the separator that the ISO 8601 combined date-time format requires. You can read it as an abbreviation for Time.

The Z stands for the Zero timezone, as it is offset by 0 from the Coordinated Universal Time (UTC).

Both characters are just static letters in the format, which is why they are not documented by the datetime.strftime() method. You could have used Q or M or Monty Python and the method would have returned them unchanged as well; the method only looks for patterns starting with % to replace those with information from the datetime object.

omarbensalem
Esteemed Contributor

Re: Timestamp format ("2017-12-21T13:33:25.494Z")

Yep; you saw it right !

It's from a web service !

So

timestamp(Now(),'YYYY-MM-DD hh:mm:ss.ff')

would do the trick?

sureshqv
Esteemed Contributor III

Re: Timestamp format ("2017-12-21T13:33:25.494Z")

yes it will  i think.

in python here the script

x.strftime("%Y-%m-%dT%H:%M:%S%Z")
'2015-03-26T10:58:51'

sureshqv
Esteemed Contributor III

Re: Timestamp format ("2017-12-21T13:33:25.494Z")

or you can try with

purgechar() in  timestamp to exclude that  then you will get exact output.

omarbensalem
Esteemed Contributor

Re: Timestamp format ("2017-12-21T13:33:25.494Z")

I'm trying to send data to the web service not pull from it.

So I have to format my dates the right way to send them