Re: Inserting Values into Interval

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: Inserting Values into Interval
Дата
Msg-id h1t6gf$sde$3@reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на Inserting Values into Interval  (BlackMage <dsd7872@uncw.edu>)
Список pgsql-general
On 2009-06-23, BlackMage <dsd7872@uncw.edu> wrote:

>
> Well what format should be used then?
>
> The application works like this. Users use a watch time how fast they run
> from point A to point B. Afterwards they enter the time taken, say 5 minutes
> 39 seconds, into a field. The field already checks to make sure the time is
> entered in the correct format. After that it takes the time entered in that
> fields an enters it into a the db.
>
> So what other field would you enter this into in the db?

postgres likes 00:05:39  and 5m39s
it also accepts 5m39 and 0:5:39

so if you can translate the user entered ':' to an 'm' or
prepend a '0:' to their input you should get the result you desire.

another option may be to divide the interval by 60 :)


00:05:39 is how it will represent the value normally.


On the other hand, could you train them to use 'm' instead of ':' ?



В списке pgsql-general по дате отправления:

Предыдущее
От: Marko Pahić
Дата:
Сообщение: A question about inheritance and sequence
Следующее
От: CM J
Дата:
Сообщение: Postgres 8.3.7 -- EOF on client connection