473,795 Members | 2,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[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************ *************** *************** ******@postgres ql.org>
Received: from conversion-daemon.sms1.wri ght.edu by sms1.wright.edu
(iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) id
<0H************ @sms1.wright.ed u> for sh**********@wr ight.edu; Tue, 04
May 2004 00:55:40 -0400 (EDT)
Received: from avs1.wright.edu (avs1.wright.ed u [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.ed u> for
sh**********@wr ight.edu; Tue, 04 May 2004 00:55:40 -0400 (EDT)
Received: from CONVERSION-DAEMON.avs1.wri ght.edu by avs1.wright.edu
(PMDF V6.2-X27 #30758) id <0H************ @avs1.wright.ed u> for
sh**********@wr ight.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.ed u> for sh**********@wr ight.edu; Tue, 04
May 2004 00:55:40 -0400 (EDT)
Received: from postgresql.org (svr1.postgresq l.org [200.46.204.71]) by
zippy.ims.net (8.11.6/linuxconf) with ESMTP id i444s9B02154 for
<sh**********@w right.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.postg resql.org>; Tue, 27 Apr
2004 23:15:48 -0300 (ADT)
Received: from svr1.postgresql .org ([200.46.204.71]) by localhost
(neptune.hub.or g [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id
25085-03 for <pg************ **************@ localhost.postg resql.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.n z (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@localhos t) by storm.niwa.co.n z
(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***********@p ostgresql.org
Message-id: <20************ **************@ storm.niwa.co.n z>
MIME-version: 1.0
Content-type: TEXT/PLAIN; charset=US-ASCII
Precedence: bulk
X-Original-To: pg************* *************@l oc...stgr esql.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(da te_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(da te_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*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
0 1502

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

Similar topics

8
6630
by: Ralph Freshour | last post by:
Is it possible to inhibit the browser Back/Fwd buttons via PHP? Thanks...
2
1993
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 has a variable or temp table that uses the field defined as the original varchar size. SQL Server just truncates to fit the data into the smaller varchar, and so there are no errors raised. An option suggested by a colleague is to no longer...
0
1093
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: Next GLLUG Meeting, 6 December 2003 Date: Wed, 26 Nov 2003 19:09:50 +0000 From: Zachary Struhs <gllugadmin@gllug.org.uk>
6
2786
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) using redim arrays to add to a normal byte array (2) using an ArrayList and finally (3) using a memorystream. These three classes are listed below the test sub called "TestBuildByteArray". It was interesting that using the memorystream was...
4
363
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 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...
11
1747
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 change before it goes live ... I know it's quite a long story, but i would be so happy if anyone could help me out here ... I've read on optimizing DB structure etc, but still cannot speed things up ...
13
6216
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
1873
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 member datum a pointer to an object of type Class3 from namespace A, and thus requires forward declaration. I attempted the following in the Class 2 hpp file: #include "Class1.hpp" // << Base class "A::Class1" - need this of course.
3
6697
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 function, but I want simple query like: SELECT * FROM table; to return all varchars as UTF-8, no matter how the fields were defined and which collation.
0
955
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 about it. Well, I can send you some examples that show how to download and parse emails from imap server. I have never used nntp before so.... Some examples are attached, and also a code fragment: IMAPDate.py - to convert between IMAP and...
0
9522
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10002
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7543
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.