Is this what you're trying to do?
This will round the time DOWN to 30 minute intervals.
On the hour or 30 minutes past the hour using MySQL time and math
functions.

select sec_to_time( time_to_sec( '2010-10-11 07:40:00' ) -
time_to_sec( '2010-10-11 07:40:00') mod(1800) )as ans;
+----------+
| ans      |
+----------+
| 07:30:00 |
+----------+
1 row in set (0.00 sec)

Mr.NetAdmin

On Oct 10, 6:21 pm, villas <villa...@gmail.com> wrote:
> For a Datetime field...
>
> On creating a record I wish to use a default date (say today) and
> choose only the time (selected from half hour intervals),  e.g.
> 10:30,  14:00,  19:30  etc.
>
> On editing a record,  I would maintain the date but simply allow the
> time to be edited.
>
> Can anyone make a suggestion to handle that elegantly?
>
> Thks, David

Reply via email to