Re: Validity check in to_date?

Поиск
Список
Период
Сортировка
От Alexander M. Pravking
Тема Re: Validity check in to_date?
Дата
Msg-id 20031202103059.GG87728@dyatel.antar.bryansk.ru
обсуждение исходный текст
Ответ на Re: Validity check in to_date?  (Christoph Haller <ch@rodos.fzk.de>)
Список pgsql-sql
On Tue, Dec 02, 2003 at 10:27:04AM +0100, Christoph Haller wrote:
> As far as I know these results are correct in terms of the underlying 
> C-library function mktime(). This function is intended to be used when 
> adding/subtracting intervals from a given timestamp. 

Which one? mktime() or to_date()? I'm not sure it's handy to use
to_date() for any calculations, so I'm surprised why doesn't it work
just as date_in() do.


> I don't know of any postgres function doing the check you're looking for. 

Yes, the only thing I could think now is to do something like
s/([0-9]+)\.([0-9]+)\.([0-9]+)/\3-\2-\1/ and then pass it to
CAST(... AS date) using ISO DateStyle.

(I could simply use German DateStyle in case of DD.MM.YYYY, but I deal
with several date formats, e.g. DD/MM/YYYY.)


> But I can't believe this is the first time this topic is brought up. 
> You may search the archives on "date plausibility" are related terms. 

I'm sure too, but it's really hard to find a good keyword sequence when
searching such sort of things :(

Anyway, thank you for attention.

-- 
Fduch M. Pravking


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

Предыдущее
От: Karel Zak
Дата:
Сообщение: Re: Validity check in to_date?
Следующее
От: "Alexander M. Pravking"
Дата:
Сообщение: Re: Validity check in to_date?