Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Partner
Partner

Convertolocaltime returning wrong time of the day

Hello,

I don;t think this script is working properly. any ideas why it is returning pm instead of AM?

ConvertToLocalTime(Timestamp(Now()),'GMT+02:00')

Right now I know it is AM in Paris for example.

Thanks

Tags (1)
1 Solution

Accepted Solutions
Highlighted
techvarun
Valued Contributor II

Re: Convertolocaltime returning wrong time of the day

Yes, Correct.

try and let us know the result

Thanks,

Varun

View solution in original post

13 Replies
Highlighted
devarasu07
Honored Contributor II

Re: Convertolocaltime returning wrong time of the day

Try like this

=localtime ('GMT+02:00')

Highlighted

Re: Convertolocaltime returning wrong time of the day

Perhaps you need to chance it as local first and then convert into needed like below

ConvertToLocalTime(UTC(Timestamp(Now())),'GMT+02:00')

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Partner
Partner

Re: Convertolocaltime returning wrong time of the day

Hi Devarasu,

I am trying to convert from my local time to the time to the Time in Paris.

example:

Local time : 2017-10-20 8:05:06 PM

I want to convert that to the time in Paris.

Thanks

Highlighted

Re: Convertolocaltime returning wrong time of the day

From hello one example is there related paris. Have you tried that

‎help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/converttolocaltime.htm

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
prma7799
Honored Contributor III

Re: Convertolocaltime returning wrong time of the day

Hi Anil ,

Can you please brief this

"ConvertToLocalTime(UTC(Timestamp(Now())),'GMT+02:00')"

What UTC stands for and how it is work ....

Highlighted
Partner
Partner

Re: Convertolocaltime returning wrong time of the day

Sorry Anil,

When I replaced the Timestamp(Now()) with my timestamp field name it still returns the same value.

ConvertToLocalTime(<mytimestampfield>,'GMT+02:00')  return the time in  paris now although my fied value is 2017-10-20 8:05:06 PM

Highlighted
MVP
MVP

Re: Convertolocaltime returning wrong time of the day

What UTC stands for and how it is work ....

https://www.google.co.za/search?q=UTC

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Highlighted
devarasu07
Honored Contributor II

Re: Convertolocaltime returning wrong time of the day

Highlighted

Re: Convertolocaltime returning wrong time of the day

That means, first you need to convert your now() function to local then convert into needed

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)