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: 
Not applicable

Date Issue!!!!!

Hi,

              I have a date in my database the format is

date
8/1/2013 01:00:58 am
8/1/2013 01:13:58 am
8/1/2013 01:20:58 pm

i want convert these date in to 24 hrs when am fulling the into Qlikview can any one help me

how to wright a Time stamp for date column

12 Replies
MK_QSL
MVP
MVP

Load this in your script..

Timestamp(Timestamp#(date,'d/m/yyyy hh:mm:ss tt')) as date

You will get result as below

08/01/2013 01:00:58
08/01/2013 01:13:58
08/01/2013 13:20:58

Here I have considered that your format is d/m/yyyy. But if it is m/d/yyyy, you can change accordingly

To get simply date, you can use below

Date(FLOOR(Timestamp#(date,'d/m/yyyy hh:mm:ss tt'))) as date

To get time

Time(Frac(Timestamp#(date,'d/m/yyyy hh:mm:ss tt'))) as time

CELAMBARASAN
Partner - Champion
Partner - Champion

You could use date format as

D/M/YYYY HH:mm:ss

H represent 24 hr format, h represents 12 hr format

Don't use M in time because it will represent month and m is for minutes.

Hope it helps

Not applicable
Author

I have Date field With above format in that some FIELDS are having (AM,PM) & some fields are having 24 hrs format finally i want a data in AM PM format

can u suggest plsssssss

nizamsha
Specialist II
Specialist II

TableA:

LOAD * Inline [

Date

1-04-2014 15:15

2-05-2014 11:20

];

LOAD  Date( Date#(Date,'DD-MM-YYYY hh:mm'),'DD-MM-YYYY hh:mm TT') as N1 Resident TableA;

Not applicable
Author

hi try this,

Timestamp(Timestamp#(date,'d/m/yyyy hh:mm:ss:tt'))) as date

anbu1984
Master III
Master III

Load Alt(Timestamp(Timestamp#(date,'d/m/yyyy hh:mm:ss tt')),Timestamp(Timestamp#(date,'d/m/yyyy hh:mm:ss'),'d/m/yyyy hh:mm:ss tt'));

Load * Inline [

date

08/01/2013 01:00:58 PM

08/01/2013 01:13:58 AM

08/01/2013 13:20:58 ];

MK_QSL
MVP
MVP

Load

  Alt(

  TimeStamp(TimeStamp#(Date,'D/M/YYYY hh:mm:ss tt'),'D/M/YYYY hh:mm:ss TT'),

  TimeStamp(TimeStamp#(Date,'D/M/YYYY hh:mm:ss'),'D/M/YYYY hh:mm:ss TT'),

  ) as Date

Inline

[

  Date

  8/1/2013 01:00:58 am

  8/1/2013 01:13:58 am

  8/1/2013 01:20:58 pm

  9/1/2013 13:10:10

  10/1/2014 15:10:10

];

Update : Ohhh... Anbu has already replied similar to my one

Anonymous
Not applicable
Author

Hi,

Use HH:mm:ss as format

HTH

Regards,

NRC.

Not applicable
Author

i want to distribute the date and time separate