pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ISO8601 Time and ODBC
2+ messages / 2 participants
[nested] [flat]

* ISO8601 Time and ODBC
@ 2000-09-06 15:23 Carl Shelbourne <Carl.Shelbourne@marconi.com>
  2000-09-11 15:38 ` Re: ISO8601 Time and ODBC Thomas Lockhart <lockhart@alumni.caltech.edu>
  0 siblings, 1 reply; 2+ messages in thread

From: Carl Shelbourne @ 2000-09-06 15:23 UTC (permalink / raw)
  To: 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






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: ISO8601 Time and ODBC
  2000-09-06 15:23 ISO8601 Time and ODBC Carl Shelbourne <Carl.Shelbourne@marconi.com>
@ 2000-09-11 15:38 ` Thomas Lockhart <lockhart@alumni.caltech.edu>
  0 siblings, 0 replies; 2+ messages in thread

From: Thomas Lockhart @ 2000-09-11 15:38 UTC (permalink / raw)
  To: Carl Shelbourne <Carl.Shelbourne@marconi.com>; +Cc: pgsql-interfaces

> 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.

select date_part('timezone', timefield)

will do it, so just return another column in the query.

                    - Thomas



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2000-09-11 15:38 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-09-06 15:23 ISO8601 Time and ODBC Carl Shelbourne <Carl.Shelbourne@marconi.com>
2000-09-11 15:38 ` Thomas Lockhart <lockhart@alumni.caltech.edu>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox