• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Military time Diff (time calcuation)

#1 2010-04-08 21:27:54

midwestdedicated
New member
Registered: 2006-11-22
Posts: 5

Military time Diff (time calcuation)

I am trying to figure out how to take to string amounts (military times) and get a difference between them

Begin Time : "08:00"
End Time :   "17:15"

and get 9.25 hours out of that...

Been working on it for a while and cannot figure it out.  Any ideas?

Thanks,

Offline

#2 2010-04-09 06:15:17

shong
Talend team
Registered: 2007-08-29
Posts: 10306
Website

Re: Military time Diff (time calcuation)

Hello
Parsing the string to Date and get the milliseconds.
expression on tMap:

Code:

((TalendDate.parseDate("HH:mm",row1.endTime).getTime()-TalendDate.parseDate("HH:mm",row1.beginTime).getTime())/3600)/1000d

Best regards
Shong


Uploaded Images


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Online

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Military time Diff (time calcuation)

Board footer

Powered by FluxBB