Search Postgresql Archives

Re: Inserting Values into Interval

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2009-06-23, BlackMage <dsd7872@xxxxxxxx> 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 ':' ?



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux