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

ISO8601 Time and ODBC

From: "Carl Shelbourne" <Carl(dot)Shelbourne(at)marconi(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: ISO8601 Time and ODBC
Date: 2000-09-06 15:23:59
Message-ID: 80256952.00549D8D.00@marconicomms.com (view raw or flat)
Thread:
Lists: pgsql-interfaces

I am trying to get a fully qualified ISO8601 string

yyyy-mm-dd hh:mm:ss.h+MM:SS where MM:SS are the time offsets to GMT.

I am Using Postgres 7, UNIXodbc.

Using psql to query the table I get the time as:

2000-08-30 12:00:00+01

But the query via ODBC returns a SQL_C_TYPE_TIMESTAMP struct defined as

SQL_C_TYPE_TIMESTAMP  SQL_TIMESTAMP_STRUCT struct tagTIMESTAMP_STRUCT {
     SQLSMALLINT year;
     SQLUSMALLINT month;
     SQLUSMALLINT day;
     SQLUSMALLINT hour;
     SQLUSMALLINT minute;
     SQLUSMALLINT second;
     SQLUINTEGER fraction;
} TIMESTAMP_STRUCT;

The problem I have is I am working across timezones and I need to know the time
offset to GMT. Currently I am in the UK on BST +01:00, which psql seems to
return,

Does anybody know how I can get the offset to the time returned by Postgres
using ODBC??, this is not included in the above struct.

Thanks

Carl




Responses

pgsql-interfaces by date

Next:From: Alec SmecherDate: 2000-09-06 20:01:33
Subject: JDBC Insert row?
Previous:From: Bob KlineDate: 2000-09-06 12:56:53
Subject: Re: JDBC Driver Help...

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