and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello,
I am trying to round off a time value to the nearest half hour or hour.
I am calculating job times that may be anywhere from 1 to 6 hours.
For example a job may spec at 70 minutes long (4200 seconds), to make it to the next half hour I'd take it up to 5400 sec.
These intervals relate to an actual time on a job schedule as job times available.
How would I take any job duration interval and round it to the nearest half hour?
SELECT SEC_TO_TIME(TIME_TO_SEC('$start_time') + '$work_time') AS 'job_end'
If I keep it to half hour increments, the starting time will always be a good calculation point, but I'll never know what the job duration time is. Somewhere down the line I need to get the job duration to equal a half hour time value before calculating the end of the job and the beginning of the next.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Very cool, thanks.
This worked:
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]