Skip site navigation (1) Skip section navigation (2)

Error in date_trunc function?

From: Marat Khairullin <xmm(at)rambler(dot)ru>
To: postgres-general <pgsql-general(at)postgresql(dot)org>
Subject: Error in date_trunc function?
Date: 2001-10-31 15:17:28
Message-ID: 20011031181728.540f6cf3.xmm@rambler.ru (view raw or flat)
Thread:
Lists: pgsql-general
Compare TZ part of date_func function output with param 'month' and other.
Is it error?

netquote=> select date_trunc('century', now());
       date_trunc       
------------------------
 2000-01-01 00:00:00+03
(1 row)

netquote=> select date_trunc('year', now());
       date_trunc       
------------------------
 2001-01-01 00:00:00+03
(1 row)

netquote=> select date_trunc('month', now());
       date_trunc       
------------------------
 2001-10-01 00:00:00+04
(1 row)

netquote=> select date_trunc('day', now());
       date_trunc       
------------------------
 2001-10-31 00:00:00+03
(1 row)

netquote=> select date_trunc('hour', now());
       date_trunc       
------------------------
 2001-10-31 18:00:00+03
(1 row)

netquote=> select date_trunc('minute', now());
       date_trunc       
------------------------
 2001-10-31 18:12:00+03
(1 row)

netquote=> select date_trunc('second', now());
       date_trunc       
------------------------
 2001-10-31 18:12:24+03
(1 row)

-- 
Marat Khairullin        8->     mailto:xmm(at)rambler(dot)ru
               	                Marat(dot)Khairullin(at)f92(dot)n5049(dot)z2(dot)fidonet(dot)org

Responses

pgsql-general by date

Next:From: Raise ExceptionDate: 2001-10-31 15:52:14
Subject: Best way to store/search phone numbers?
Previous:From: wsheldahDate: 2001-10-31 15:16:32
Subject: alter table workaround

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group