freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Bradley Bell <bradleyb AT u.washington.edu>
- To: TDS Development Group <freetds AT franklin.oit.unc.edu>
- Subject: Re: datetime format
- Date: Mon, 17 Dec 2001 12:55:24 -0800
On Sun, Dec 16, 2001 at 08:11:05PM -0500, James K. Lowden wrote:
> Bradley Bell wrote:
> >
> > Hi, when selecting a datetime value using freetds, I get values such as:
> > "Dec 13 2001 05:58PM"
> > Whereas the same select statement in the MS SQL Query analyzer give:
> > "2001-12-13 17:58:55.000"
> >
> > Since I need to be able to convert back and forth between datetime values
> > and unix timestamps, I need to at least have the number of seconds
> > (millisecs don't matter).
> >
> > Is this a problem in FreeTDS, or a limitation of the TDS protocol, or
> > what?
> > Is it possible to make FreeTDS always return the number of seconds in
> > datetime fields?
>
> Brad,
>
> MS SQL Query Analyzer is an ODBC tool. It's default datetime display is
> controlled by some ODBC settings. I don't know the details.
>
> To illustrate, try Microsoft's isql command-line tool. I think you'll
> find it represents datetimes the way, say, sqsh does.
isql uses db-lib, so maybe this is a limitation of db-lib?
> > (I don't want to use CONVERT, because the select statements in this
> > application should remain portable)
>
> If the server is consistent (always MS SQL Server or Sybase), the most
> portable way probably *is* to coerce the format with convert.
It needs to be portable to several different backends. MS/Sybase is the
only one that seems to need a custom select statement for timestamp/datetime
values. I see that when freetds is being used as an odbc driver, it also
returns: (with unixodbc's isql)
SQL> select getdate();
+--------------------+
| Dec 17 2001 12:28PM|
+--------------------+
That's not right, is it?
-brad
--
Bradley Bell
Computer Support Analyst
University of Washington
Classroom Support Services
-
datetime format,
Bradley Bell, 12/13/2001
- <Possible follow-up(s)>
- Re: datetime format, James Cameron, 12/13/2001
- Re: datetime format, James K. Lowden, 12/16/2001
- Re: datetime format, Winkless, Geoff, 12/17/2001
- Re: datetime format, Lowden, James K, 12/17/2001
- Re: datetime format, Bradley Bell, 12/17/2001
- Re: datetime format, James Cameron, 12/17/2001
- Re: datetime format, Michael Peppler, 12/17/2001
- Re: datetime format, James K. Lowden, 12/18/2001
- Re: datetime format, Steve Langasek, 12/19/2001
- Re: datetime format, Brian Bruns, 12/19/2001
- Re: datetime format, Franck Martin, 12/19/2001
- Re: datetime format, Steve Langasek, 12/19/2001
- Re: datetime format, Bradley Bell, 12/19/2001
- Re: datetime format, Bradley Bell, 12/19/2001
- Re: datetime format, Michael Peppler, 12/20/2001
Archive powered by MHonArc 2.6.24.