Hi,

That is because the hours depend on your timezone.

A diff of say 2 hours, would give you a date of 7200 seconds, which
translates to January 1, 1970 02:00:00 GMT.

The hours are 2 only if your client (or servers if it is a filter) is set
for GMT.

        Best Regards - Misi, RRR AB, http://www.rrr.se

Products from RRR Scandinavia (Best R.O.I. Award at WWRUG10):
* RRR|License - Not enough Remedy licenses? Save money by optimizing.
* RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs.
Find these products, and many free tools and utilities, at http://rrr.se.

> All,
> Found an oddity the other day.
>
> I was taking 2 Date/Time values and trying to break out days, hours,
> minutes, and seconds.
>
> I used the datediff function to pull out the number of days different,
> Then used the HOURS, MINUTES, and SECONDS functions.
>
> All except HOURS worked correctly.
> HOURS(Date_Time2 - Date_Time1) = 0 (should have been 6)
> MINUTES(Date_Time2 - Date_Time1) = 47 -->Correct
> SECONDS(Date_Time2 - Date_Time1) = 23 -->Correct.
>
> I was able to get around it by just doing the math myself,
> But I thought HOURS was supposed to return the number of hours in a Time
> Stamp.
> It's strange because it doesn't appear to be consistent in how the other
> functions work.
>
> Was wondering if this was a defect or if I was just not using it
> correctly.
>
> ARS 7.1 Patch 8
> MS SQL Server 2005
> Windows Server 2003
>
> Thanks,
> Matt P.
>
>
> _______________________________________________________________________________
> UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
> attend wwrug11 www.wwrug.com ARSList: "Where the Answers Are"
>

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug11 www.wwrug.com ARSList: "Where the Answers Are"

Reply via email to