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: 
RVeitch_84
Creator
Creator

Date and time diff

I have a variable in a tMap that holds the hours and mins of a date diff, example result 02:15

I need to send that into excel and use it in a pivot table, but excel adds "1/1/1970"

0695b00000HtfSnAAJ.png

So I was wondering if I instead of just holding the 02:15 in that variable can I add the current yyyy-MM-dd as a date.

So my file result into excel as a date would be 2021-08-21 02:15.

I think then I could parse out the hours and mins with hh:mm in excel?

Any help would be appreciated .

Unless their is a better way to do the date diff other than this:

  • TalendDate.diffDate(row29.Time, row29.CleaningTime , "SSS")  ms
  • String.format("%02d:%02d", (Var.ms / (1000 * 60 * 60)) % 24, (Var.ms / (1000 * 60)) % 60)  total_time
  • TalendDate.parseDate("hh:mm",Var.total_time) var1

Labels (2)
1 Reply
Anonymous
Not applicable

Hi

Try this expression build the datetime format:

TalendDate.formatDate("yyyy-MM-dd",TalendDate.getCurrentDate())+" "+your_total_time_string

 

Regards

Shong