In sybase is there any built in functions to convert a seconds value into hours, minutes, and seconds?
+2
A:
I don't know if there is such a function, but if there isn't, the simple formulae are:
HH = floor(seconds / 3600)
MM = floor(seconds / 60) % 60
SS = seconds % 60
Alnitak
2009-03-04 17:14:15
+1
A:
If it's value limited by 1 day, you can use this:
datepart(hour, dateadd(second, value, '1900-01-01'))
datepart(minute, dateadd(second, value, '1900-01-01'))
datepart(second, dateadd(second, value, '1900-01-01'))
Max Gontar
2009-03-04 17:23:22
A:
A common 'seconds' dimension is 'seconds since the unix epoch' or 'time_t'. If this is what you are referring to you can do something like
select dateadd(SECOND, 123456, '1970-01-01')
and you will have a datetime value which can be deconstructed into the various parts via DATEPART
pjjH
Paul Harrington
2009-05-29 03:32:01