Getting seconds from a datetime field

Eric Deutsch edeutsch at systemsbiology.org
Tue Jul 2 10:36:19 EDT 2002



Hi Dan, if you have a recent version of FreeTDS (something later than
the original 0.53 release itself), you should be able to fix this simply
by adjusting your /usr/local/freetds/etc/locales.conf file to read
something
like:

[default]
        date format = %Y-%m-%d %H:%M:%S

[en_US]
        date format = %Y-%m-%d %H:%M:%S
        language = us_english
        char set = iso_1

If you don't already have such a file (it might be in a different
location than mine), you probably need to upgrade to the latest version
which will include such a file in the distribution.

Hope this works for you,
Eric


> -----Original Message-----
> From: Dan Harris [mailto:coronadh at coronasolutions.com]
> Sent: Tuesday, July 02, 2002 9:25 AM
> To: TDS Development Group
> Subject: [freetds] Re: Getting seconds from a datetime field
> 
> No, it's a datetime type. When I select it, it returns a format of
> 
> Jun  1 2002 12:01AM
> 
> I would rather have:
> 
> 2002-06-01 00:01:34
> 
> I have tried cast and convert(varchar, colname) but nothing seems to
> return
> seconds.
> 
> -Dan
> 
> On Monday 01 July 2002 10:19 pm, you wrote:
> 
> > Dan,
> >
> > Are you using smalldatetime?  It lacks seconds and milliseconds.
> >
> > If you're thinking of cast/convert, see
> > http://www.SchemaMania.org/jkl/booksonline/SQLBOL70/html/ca-co_1.htm
> 
> 
> ---
> You are currently subscribed to freetds as:
[edeutsch at systemsbiology.org]
> To unsubscribe, forward this message to leave-freetds-
> 127899P at franklin.oit.unc.edu



More information about the FreeTDS mailing list