Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aw8QV-0006Ma-Io for pgsql-docs@arkaria.postgresql.org; Fri, 29 Apr 2016 13:25:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aw8QV-0007A0-55 for pgsql-docs@arkaria.postgresql.org; Fri, 29 Apr 2016 13:25:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1avqMF-0005CH-6K for pgsql-docs@postgresql.org; Thu, 28 Apr 2016 18:08:11 +0000 Received: from smtp34.i.mail.ru ([94.100.177.94]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1avqM6-0007UZ-3v for pgsql-docs@postgresql.org; Thu, 28 Apr 2016 18:08:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=wBDd+G0sxrjqB75QSBNGOdcx9mQXOXRLuR/1P9bgDnQ=; b=d/L1c0hoN8yhwMsJIzfy5DiitOBnDE/19oH4TMfkagKrD0pVpz+qqy+ydjHglQK93rtrtGpx1+kwV42avc+xISLlatpkIi1ALv/TeJ6Hk0C3Z+AMAFaRf+ZCm9x205HV/3K2Et5aV8L8M5YqYTz+9kbGYzUWopDrYARSI1B531o=; Received: from 98.126.201.114.static-us.twistednetworks.net ([98.126.201.114]:52613 helo=nikita_desk) by smtp34.i.mail.ru with esmtpa (envelope-from ) id 1avqM3-0006uF-PV for pgsql-docs@postgresql.org; Thu, 28 Apr 2016 21:08:00 +0300 Date: Thu, 28 Apr 2016 11:07:53 -0700 From: Mavka To: pgsql-docs@postgresql.org Subject: Date formatting Message-ID: <20160428110753.2700f00d@nikita_desk> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mras: OK X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org To convert a string to date I need to omit meaningless parts. I found this format working well (Twitter dump format): SELECT to_timestamp( 'Tue Sep 24 08:56:18 +0000 2013', 'xxx Mon DD HH24:MI:SS xxxxx YYYY' ) -- 2013-09-24 08:56:18-07 In place of "xxx" I can use any non-reserved symbols, e.g.: 'aaa Mon DD HH24:MI:SS bbbbb YYYY' Number of symbols can vary in some limits, e.g. 'aa' is still working. Is it hack or normal behaviour of parser? I did not find any mention of wildcards or placeholders in documentation: http://www.postgresql.org/docs/9.5/static/functions-formatting.html Best regards, Mavka P.S. I use PostgreSQL 9.4. -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs