Question

how to read date time in hours and mintues


Badge
Hi, I am very new to FME.  I am creating my first report in FME and having some issues.  I am trying to pull report from excel and i need to get sum of ri x Ni.  In my excel worksheet is sum read as 1633:11 but in fx column it displays 3/8/1900 1:11:52AM.  I am writing the final results in Microsoft Access.  How do I get my results to display 1633:11.

 

 

Thank you

 

R

 

 

 

 

2 replies

Userlevel 2
Badge +17
Hi,

 

 

I'm unclear what "sum of ri x Ni" and "fx column" mean.

 

If you need to calculate the time difference between "3/8/1900 1:11:52AM" and "1/1/1900 0:0:0", the DateFormatter transformer might help you.

 

 

The transformer with the following setting converts the datetime string to the number of seconds from the epoch (in this case, the result will be negative since the epoch is 1970-01-01 00:00:00 UTC)

 

-----

 

Source Date Format: Unknown - Automatic Detection

 

Destination Data Format: %s

 

-----

 

You can calculate the difference in seconds and then convert it to hours and minutes.

 

 

... but the time difference between them is 1585:11.

 

31 days (1 Jan. 00:00:00 - 1 Feb. 00:00:00)

 

+ 28 days (1 Feb. 00:00:00 - 1 Mar. 00:0:00)

 

+ 7 days (1 Mar. 00:00:00 - 8 Mar. 00:00:00) = 66 days

 

66 days x 24 hours + 1:11:58 = 1585 hours 11 minutes 58 seconds

 

 

Note that the year 1900 is not a leap year.

 

Leap year - Wikipedia (http://en.wikipedia.org/wiki/Leap_year)

 

What is a Leap Year? (http://www.timeanddate.com/date/leapyear.html)

 

 

Takashi
Badge +2
As far As I understand the question, you are reading the data from Excel file which has time  in Hours:Min format and you want the output (sum of the column) in Hours:Minutes format in Microsoft Access. Right?

Reply