![]() | |
![]() |
| | Thread Tools | Display Modes |
#21
| |||
| |||
|
|
Patrick Scharrenberg <pittipatti (AT) web (DOT) de> wrote: I'd like to represent an interval like '1 day 1h 2m 12s' in days, in this case 25 I assume you mean "hours". Ohh, yes you're right :-) |
|
Is there a more convenient way of returning the number of hours than with a contruct like the following? I don't think there is a better way. You could write an SQL function around it: |
|
And what if the interval is longer than a month? How many day's has an "interval-month"? There is an instructive comment in include/utils/timestamp.h: #define DAYS_PER_MONTH 30 /* assumes exactly 30 days per month */ |
#22
| |||
| |||
|
|
Patrick Scharrenberg <pittipatti (AT) web (DOT) de> wrote: I'd like to represent an interval like '1 day 1h 2m 12s' in days, in this case 25 I assume you mean "hours". Ohh, yes you're right :-) |
|
Is there a more convenient way of returning the number of hours than with a contruct like the following? I don't think there is a better way. You could write an SQL function around it: |
|
And what if the interval is longer than a month? How many day's has an "interval-month"? There is an instructive comment in include/utils/timestamp.h: #define DAYS_PER_MONTH 30 /* assumes exactly 30 days per month */ |
#23
| |||
| |||
|
|
Patrick Scharrenberg <pittipatti (AT) web (DOT) de> wrote: I'd like to represent an interval like '1 day 1h 2m 12s' in days, in this case 25 I assume you mean "hours". Ohh, yes you're right :-) |
|
Is there a more convenient way of returning the number of hours than with a contruct like the following? I don't think there is a better way. You could write an SQL function around it: |
|
And what if the interval is longer than a month? How many day's has an "interval-month"? There is an instructive comment in include/utils/timestamp.h: #define DAYS_PER_MONTH 30 /* assumes exactly 30 days per month */ |
#24
| |||
| |||
|
|
Patrick Scharrenberg <pittipatti (AT) web (DOT) de> wrote: I'd like to represent an interval like '1 day 1h 2m 12s' in days, in this case 25 I assume you mean "hours". Ohh, yes you're right :-) |
|
Is there a more convenient way of returning the number of hours than with a contruct like the following? I don't think there is a better way. You could write an SQL function around it: |
|
And what if the interval is longer than a month? How many day's has an "interval-month"? There is an instructive comment in include/utils/timestamp.h: #define DAYS_PER_MONTH 30 /* assumes exactly 30 days per month */ |
#25
| |||
| |||
|
|
Patrick Scharrenberg <pittipatti (AT) web (DOT) de> wrote: I'd like to represent an interval like '1 day 1h 2m 12s' in days, in this case 25 I assume you mean "hours". Ohh, yes you're right :-) |
|
Is there a more convenient way of returning the number of hours than with a contruct like the following? I don't think there is a better way. You could write an SQL function around it: |
|
And what if the interval is longer than a month? How many day's has an "interval-month"? There is an instructive comment in include/utils/timestamp.h: #define DAYS_PER_MONTH 30 /* assumes exactly 30 days per month */ |
![]() |
| Thread Tools | |
| Display Modes | |
| |