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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Convert field and Time date to Local GMT

Hi everyone,

I have data which there are include date and time field format.

I want to change the date format to our local GMT+8 . How can I do in qlikview.

I have try to use ConvertToLocalTime function but the result turns out differently.

TRAN_DATETRAN_TIMEDATE_TIMEDATE_TIME_NEW
07/20/161:16:12 AM07/20/2016 01:12:128/14/4102 4:07:34 PM
07/20/161:16:58 AM07/20/2016 01:12:589/4/4080 2:46:56 AM


  LOAD FILE_NAME,

    FILE_YEAR,

    FILE_DATE,

    NUM,

    TRAN_DATE,

    TRAN_TIME,

    DATE(TRAN_DATE, 'MM/DD/YYYY') & ' ' & TIME(TRAN_TIME, 'HH:MM:SS') AS DATE_TIME,

   ConvertToLocalTime(DATE(TRAN_DATE, 'MM/DD/YYYY')/TIME(TRAN_TIME, 'HH:MM:SS'), 'GMT+08:00') AS DATE_TIME_NEW

1 Solution

Accepted Solutions
MarcoWedel

Hi,

maybe helpful:

QlikCommunity_Thread_230641_Pic1.JPG

table1:

LOAD *,

    ConvertToLocalTime(DATE_TIME, 'GMT+08:00') as DATE_TIME_NEW;

LOAD *,

    Timestamp(TRAN_DATE+TRAN_TIME) as DATE_TIME;

LOAD Date#(TRAN_DATE, 'MM/DD/YY') as TRAN_DATE,

    Time#(TRAN_TIME, 'hh:mm:ss TT') as TRAN_TIME

INLINE [

    TRAN_DATE, TRAN_TIME

    07/20/16, 1:16:12 AM

    07/20/16, 1:16:58 AM

    07/21/16, 2:16:12 PM

    07/21/16, 2:16:58 PM

];

regards

Marco

View solution in original post

4 Replies
Anil_Babu_Samineni

Perhaps this

ConvertToLocal(TRAN_DATE, 'GMT+8:00') as  DATE_TIME_NEW

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
MarcoWedel

Hi,

maybe helpful:

QlikCommunity_Thread_230641_Pic1.JPG

table1:

LOAD *,

    ConvertToLocalTime(DATE_TIME, 'GMT+08:00') as DATE_TIME_NEW;

LOAD *,

    Timestamp(TRAN_DATE+TRAN_TIME) as DATE_TIME;

LOAD Date#(TRAN_DATE, 'MM/DD/YY') as TRAN_DATE,

    Time#(TRAN_TIME, 'hh:mm:ss TT') as TRAN_TIME

INLINE [

    TRAN_DATE, TRAN_TIME

    07/20/16, 1:16:12 AM

    07/20/16, 1:16:58 AM

    07/21/16, 2:16:12 PM

    07/21/16, 2:16:58 PM

];

regards

Marco

Not applicable
Author

Thanks Marco !

Its work.

MarcoWedel

You're welcome.

Glad it helped

Regards

Marco