|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Is there a way to format output of timediff in following format: day
hours minutes seconds? eg: timediff(Oct 16 2007 130000 - Oct 15 110000) = 1 days 2 hours 00 minutes 00 secs |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
crybaby wrote:
> Is there a way to format output of timediff in following format: day > hours minutes seconds? > > eg: > timediff(Oct 16 2007 130000 - Oct 15 110000) = 1 days 2 hours 00 > minutes 00 secs Yes |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Oct 16, 5:21 pm, "Paul Lautman" <paul.laut...@btinternet.com>
wrote: > crybaby wrote: > > Is there a way to format output of timediff in following format: day > > hours minutes seconds? > > > eg: > > timediff(Oct 16 2007 130000 - Oct 15 110000) = 1 days 2 hours 00 > > minutes 00 secs > > Yes How do you do this in mysql so that format is in ddhhmmss, someFormatFunction(timediff(Oct 16 2007 130000 - Oct 15 110000)) = 1 days 2 hours 00 minutes 00 secs ? |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On 17 Oct, 01:50, crybaby <joemystery...@gmail.com> wrote:
> On Oct 16, 5:21 pm, "Paul Lautman" <paul.laut...@btinternet.com> > wrote: > > > crybaby wrote: > > > Is there a way to format output of timediff in following format: day > > > hours minutes seconds? > > > > eg: > > > timediff(Oct 16 2007 130000 - Oct 15 110000) = 1 days 2 hours 00 > > > minutes 00 secs > > > Yes > > How do you do this in mysql so that format is in ddhhmmss, > someFormatFunction(timediff(Oct 16 2007 130000 - Oct 15 110000)) = 1 > days 2 hours 00 minutes 00 secs ? Well according to the manual, the output format of timediff appears to be hours:minutes:seconds.fractionsofseconds You can use a selection of LEFT(), SUBSTR, DIV, % (modulus), REPLACE(), CONCAT; to reformat it to your hearts content. |
|
![]() |
| Outils de la discussion | |
|
|