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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
balasundaram
Creator II
Creator II

Time to Date

i want to convert 15-01-2014  12:00:00 to 1/15/2014

how ??

5 Replies
nagaiank
Specialist III
Specialist III

Try

=Date(Floor(Date#('15-01-2014 12:00:00','DD-MM-YYYY hh:mm:ss')),'M/D/YYYY')

maxgro
MVP
MVP

=date(date#('15-01-2014  12:00:00', 'DD-MM-YYYY  hh:mm:ss'),'M/DD/YYYY')

EDIT you can read this for detailed help

Primer for QlikView Date fields

sundarakumar
Specialist II
Specialist II

=date(date#('15-01-2014 12:12:2014','DD-MM-YYYY hh:mm:ss'))

this will do. if u convert it to number u will see the corresponding time fraction. with this u can change it back to timestamp at any point..

-Sundar

Not applicable

hi

try this

date(date#('15-01-2014 12:00:00','DD-MM-YYYY hh:mm:ss'),'MM/DD/YYYY')

MarcoWedel

Hi,

supposed your timestamp values are stored in a field 'yourField',then

if yourField is type text:

date(timestamp#(yourField, 'DD-MM-YYYY hh:mm:ss'), 'M/DD/YYYY')

if yourField is type Timestamp:

date(yourField, 'M/DD/YYYY')

Both methods leave the time part of yourField untouched, i.e. whenever you use the result as a dimension, you probably get multiple occurrences of 1/15/2014 (each with a different, unvisible time value).

So if you intend to get numerically identical values per date (i.e. dates not timestamps), you have to strip the time part like:

if yourField is type text:

date(floor(timestamp#(yourField, 'DD-MM-YYYY hh:mm:ss')), 'M/DD/YYYY')

or

date(daystart(timestamp#(yourField, 'DD-MM-YYYY hh:mm:ss')), 'M/DD/YYYY')

or

date(dayname(timestamp#(yourField, 'DD-MM-YYYY hh:mm:ss')), 'M/DD/YYYY')

if yourField is type Timestamp:

date(floor(yourField), 'M/DD/YYYY')

or

date(daystart(yourField), 'M/DD/YYYY')

or

date(dayname(yourField), 'M/DD/YYYY')

hope this helps


regards


Marco