If they are character fields, you'll need to push the value into an
integer field in order to convert to epoch seconds.

If they are already date/time fields, you are gold.

1) So, set 'Diff' = $Resolved$ - $Created$

Setting Days:

2a) Set 'Days' = $Diff$ / 86400. Make sure to use an int field for Hrs
to make sure you cut off the decimal. This will give you the number of
hours

2b) Now, set 'Diff' = $Diff$ - ($Days$ * 86400)



Setting Hours:

3a) Now, set 'Hrs' = $Diff$ / 3600

3b) Set 'Diff' = $Diff$ - ($Hrs$ * 3600)


Setting Minutes:

4a) Set 'Mins' = $Diff$ / 60

4b) Set 'Diff' = $Diff$ - ($Mins$ * 60)


Setting Seconds:

5) Set 'Secs' = $Diff$ [Or skip 4b and just set 'Secs' = $Diff$ -
($Mins$ * 60)]





Make sure all of your Diff, Mins, Secs, Hrs, Days are all int fields.
Make sure you do it in order or you will get wrong numbers.

I think this should work. There may be a little cleanup on items I might
have left out or hastily mis-typed.



Thanks,


Gary Opela, Jr

Sr. Remedy Developer

Leader Communications, Inc.

405 736 3211


-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[EMAIL PROTECTED] On Behalf Of T. Dee
Sent: Tuesday, November 20, 2007 12:47 PM
To: arslist@ARSLIST.ORG
Subject: Question: Date and Time Calculation

I'm trying to do a set fields based on Date / Time Created - Date / Time
Resolved

I want to calculate the diference between when the ticket was opened and
when it
was closed - for example:

Date / Time Created:  11/20/2007 8:01 AM
Date / Time Resolved:  11/21/2007 5:04 PM

Answer:  xx days xx hours xx minutes xx seconds

Any help is appreciated. 

Thanks!

________________________________________________________________________
_______
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"

Reply via email to