473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

[Fwd: help building datetime from varchars]


I have tried contacting the list owner, but nobody responds so I am
knowingly sending administrative mail to the list. Sorry folks.

For months, particularly since February, I have been receiving e-mail
that is out-of-date. Since they are relatively old (weeks to months) I
cannot say whether or not they are duplicates. A copy of such an e-mail
I just received this morning is attached along its headers. Note that
postgresql.org received it on 27 Apr and that it was relayed to my mail
server within the last 24 hours (May 3 at 11:54pm GMT-4 to be exact).
Why does this happen and can't it be made to stop? (And I'm not picking
on Brent. His is just one of 8 messages I received this morning from
the month of April.)

Shane

-------- Original Message --------
Return-path:
<pg*********************************************** *@postgresql.org>
Received: from conversion-daemon.sms1.wright.edu by sms1.wright.edu
(iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) id
<0H************@sms1.wright.edu> for sh**********@wright.edu; Tue, 04
May 2004 00:55:40 -0400 (EDT)
Received: from avs1.wright.edu (avs1.wright.edu [130.108.128.93]) by
sms1.wright.edu (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8
2003)) with ESMTP id <0H************@sms1.wright.edu> for
sh**********@wright.edu; Tue, 04 May 2004 00:55:40 -0400 (EDT)
Received: from CONVERSION-DAEMON.avs1.wright.edu by avs1.wright.edu
(PMDF V6.2-X27 #30758) id <0H************@avs1.wright.edu> for
sh**********@wright.edu; Tue, 04 May 2004 00:55:40 -0400 (EDT)
Received: from zippy.ims.net (zippy.ims.net [208.166.202.2]) by
avs1.wright.edu (PMDF V6.2-X27 #30758) with ESMTP id
<0H************@avs1.wright.edu> for sh**********@wright.edu; Tue, 04
May 2004 00:55:40 -0400 (EDT)
Received: from postgresql.org (svr1.postgresql.org [200.46.204.71]) by
zippy.ims.net (8.11.6/linuxconf) with ESMTP id i444s9B02154 for
<sh**********@wright.edu>; Mon, 03 May 2004 23:54:22 -0500
Received: from localhost (unknown [200.46.204.2]) by
svr1.postgresql.org (Postfix) with ESMTP id 49B76D1B50C for
<pg**************************@localhost.postgresql .org>; Tue, 27 Apr
2004 23:15:48 -0300 (ADT)
Received: from svr1.postgresql.org ([200.46.204.71]) by localhost
(neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id
25085-03 for <pg**************************@localhost.postgresql .org>;
Tue, 27 Apr 2004 23:15:50 -0300 (ADT)
Received: from clam.niwa.co.nz (clam.niwa.cri.nz [202.36.29.1]) by
svr1.postgresql.org (Postfix) with ESMTP id BFB03D1B448 for
<pg***********@postgresql.org>; Tue, 27 Apr 2004 23:15:43 -0300 (ADT)
Received: from storm.niwa.co.nz (storm.niwa.co.nz [192.168.59.10]) by
clam.niwa.co.nz (8.12.3p3/8.12.3) with ESMTP id i3S2FjSb092102 for
<pg***********@postgresql.org>; Wed, 28 Apr 2004 14:15:46 +1200 (NZST
envelope-from b.****@niwa.co.nz)
Received: from localhost (woodb@localhost) by storm.niwa.co.nz
(8.11.6/8.11.6) with ESMTP id i3S2Fjc55463 for
<pg***********@postgresql.org>; Wed, 28 Apr 2004 14:15:45 +1200
Date: Wed, 28 Apr 2004 14:15:45 +1200 (NZST)
From: Brent Wood <b.****@niwa.co.nz>
Subject: [GENERAL] help building datetime from varchars
In-reply-to: <Pi**************************************@emo.org. tr>
Sender: pg*****************@postgresql.org
To: pg***********@postgresql.org
Message-id: <20**************************@storm.niwa.co.nz>
MIME-version: 1.0
Content-type: TEXT/PLAIN; charset=US-ASCII
Precedence: bulk
X-Original-To: pg**************************@localhost.postgresql. org
X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang)
X-Virus-Scanned: by amavisd-new at postgresql.org
X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=
X-Spam-Level:
X-Mailing-List: pgsql-general
Original-recipient: rfc822;sh**********@wright.edu

Hopefully someone can point me in the proper direction....

I have a table containg (amongst others) two varchar attrs date_s &
time_s.

They contain strings like:

date_s | time_s
------------+----------
01/10/1989 | 00:30:00

Can someone suggest an sql to turn these into a single datetime?


I have tried the following with results I don't understand:

env2003=# select date_s || time_s, to_timestamp(date_s || time_s,'DD/MM/YYYYHH:MM:SS') from event limit 1;
?column? | to_timestamp
--------------------+------------------------
01/10/198900:30:00 | 1991-06-05 00:00:00+12
(1 row)

env2003=# select date_s || ' ' || time_s, to_timestamp(date_s || ' ' || time_s,'DD/MM/YYYY HH:MM:SS') from event limit 1;
?column? | to_timestamp
---------------------+------------------------
01/10/1989 00:30:00 | 1991-06-05 00:00:00+12
(1 row)

Thanks,

Brent Wood
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
0 1466

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ralph Freshour | last post by:
Is it possible to inhibit the browser Back/Fwd buttons via PHP? Thanks...
2
by: Miles Ashton | last post by:
A common request for enhancement to applications is to "make this field bigger". I know I've been caught with increasing a field size, and then spending hours debugging because another stored proc...
0
by: Peter Childs | last post by:
Thought this might intrest any Postgres Users in the South East England area. The main talk at this meeting is on Postgres Vs MySql. Peter Childs -------- Original Message -------- Subject:...
6
by: Dennis | last post by:
I was trying to determine the fastest way to build a byte array from components where the size of the individual components varied depending on the user's input. I tried three classes I built: (1)...
4
by: Shane D. | last post by:
I have tried contacting the list owner, but nobody responds so I am knowingly sending administrative mail to the list. Sorry folks. For months, particularly since February, I have been...
11
by: frizzle | last post by:
Hi groupies I'm building a news site, to wich a user can add new items into a mySQL db. It's still in testfase, but it's so extremely slow, i want to figure out what i'm doing wrong, or what to...
13
by: James | last post by:
Hello, I'm a newbie to Python & wondering someone can help me with this... I have this code: -------------------------- #! /usr/bin/python import sys
1
by: jake77.lucas | last post by:
I'm using 2005.Net C++ compiler. I have a base class in namespace A (call it Class1). I derive another class from it, (call it Class2) defined in namespace B. This derived class contains as a...
3
by: =?ISO-8859-2?Q?W=B3adys=B3aw_Bodzek?= | last post by:
Hi, I want to change 2 default behaviors of ms-sql server within a connection. 1. All varchar (etc.) fields should be returned as UTF-8. I know about field attribute collation and convert...
0
by: Laszlo Nagy | last post by:
agus@cs.its.ac.id wrote: Can be done via the standard imaplib module. No need to use twisted. Save it as an eml file. Use the standard email.Parser module for extracting headers. I have no clue...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.