Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

HOw to show Time along with date??

Hey ,

I am Comparing two time variables with each other.

But  the problem is these 2 variables are incomparable with each other becoz one date is in 'YYYY-DD-MM' and other in 'DD-MM-YYYY'

When i am trying to convert one date to 'YYYY-DD-MM' , my time is erased so again not comparable.

How to show time , please tell.

--------------------------------------------------------------

Directory;

LET vModifiedTime = Date(floor(FileTime('C:\Users\nikhil.garg\Desktop\Disaster_Data\Copy of Disaster.xlsx')), 'YYYY-MM-DD');

LOAD *

FROM

[Disaster_Data\Copy of Disaster.xlsx]

(ooxml, embedded labels, table is Disaster) where $(vModifiedTime) >= $(LastExecTime);

Please help.

Thanks

9 Replies
maxgro
MVP
MVP

to change format from DD-MM-YYYY to YYYY-MM-DD you can use

=Date(Date#('25-02-2012', 'DD-MM-YYYY'), 'YYYY-MM-DD')

replace '25-02-2012' with your field or var

nikhilgarg
Specialist II
Specialist II
Author

But i ahve to show time also , along with date. How can i do it ?

Not applicable

Hi Nikhil,

Try this format in your expression - "YYYY-DD-MM h:mm:ss[.fff] TT"

This format will show you time as well with AM / PM suffix.

If you want to remove AM / PM from your timestamp, remove TT from the format.

Regards,

Sarang M. Mehta

PrashantSangle

Hi,

When you use Floor() It will give rounded date .It will remove your time field

So if you need Time also then dont use Floor()

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
PrashantSangle

Hi,

and also use Timestamp(), Instead of Date()

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
maxgro
MVP
MVP

change the format

=Date(Date#('25-02-2012 14:35:03', 'DD-MM-YYYY hh:mm:ss'), 'YYYY-MM-DD hh:mm:ss')

you can try in a textbox

1.png

MarcoWedel

how do you calculate LastExecTime?

nikhilgarg
Specialist II
Specialist II
Author

Hey,

I have used $(LastExecTime) dat automatcally gves last executn time. But

format of lastexectime and modified time is dofferent. Thats the issue

Not applicable

Hi Marco,

Use function QvdCreateTime.

EG:- QvdCreateTime('C:\MyDir\MyFile.qvd')