| От | Tom Lane |
|---|---|
| Тема | Re: Query on DATETIME for a date (the whole day) |
| Дата | |
| Msg-id | 21278.1319077947@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Query on DATETIME for a date (the whole day) (Basil Bourque <basil.list@me.com>) |
| Список | pgsql-novice |
Basil Bourque <basil.list@me.com> writes:
> For a "timestamp with time zone" column, how do I find all rows where the value is within the beginning and ending of
asingle date?
If you compare a date to a timestamp, the date is taken to mean midnight
of its day. So you need something along the line of
WHERE timestampcol BETWEEN dateval AND dateval+1
> And I'm concerned about local date time. I want to find by the user's local beginning and end of the day, not UTC.
Well, you're not being too clear about what you need here, but in what
I suggest above, "midnight" will be interpreted according to the current
"timezone" setting.
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера