sachinbaan
17th October 2014, 12:22
Hi,


I want to subtract UTC date time, using another UTC date time, please tell me if any standard function available for this.

vamsi_gujjula
17th October 2014, 15:46
what are you trying to do?

UTC1 - UTC2 ????

vinceco252
17th October 2014, 17:31
The utc.add() function should do it.

benito
17th October 2014, 20:34
as vamsi said you can just directly subtract utc.date1 - utc.date2. they have the same unit which is in seconds. then you can convert that resulting number to any unit, ie days, hours, weeks, etc.

sachinbaan
18th October 2014, 06:01
Hi vamsi,

UTC1 - UTC2 , not working, so i did as follows:

utc.add(i.utc, -year, -month, -day, -hour, -minute, -second, o.utc)

sachinbaan
18th October 2014, 06:03
Hi,

As i don't want to subtract day, month or year but i want to subtract hours, so conversion in normal date wont work, so i tried this and got the result.

thanks everyone.