Skip to Content.
Sympa Menu

freetds - Re: Date Problem

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Eric Deutsch <edeutsch AT systemsbiology.org>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Date Problem
  • Date: Fri, 7 Dec 2001 16:22:30 -0800 (PST)



A feature that I've mentioned in the past and something that I've really
been meaning to do, but haven't gotten around to:

It would be sensational if one could specify in freetds.conf one's own
strftime format string. I like all my dates to show up as
'2001-12-07 15:45:22' without having to CAST and CONVERT and stuff. I do
this by manually going into the FreeTDS driver and replacing the default
format string with the one that produces this.

I'd think this would be an easy addition for those familiar with the code
(especially the freetds.conf parsing bit) and would be grateful if this
were added while someone was working on the code already.. or I'll get to
it soon.

Eric


On Thu, 6 Dec 2001, James Cameron wrote:

> James,
>
> While you've got the whole date thing in pieces on your workbench, any
> idea how I can get a datetime down to the seconds, or whatever precision
> it is being stored at?
>
> If I do a
>
> SELECT modify_stmp FROM table [...]
>
> then I get
>
> 'Feb 20 2001 10:57AM'
>
> I can get the seconds if I adjust my code as follows:
>
> SELECT CAST(modify_stmp AS VARCHAR(26)) + ' ' +
> CAST(DATEPART(SECOND, modify_stmp) AS VARCHAR(2))
> FROM table [...]
>
> but this seems somewhat verbose. Is there a better way?
>
>

--
----------------------------------------------------------------------
Eric Deutsch email: edeutsch AT systemsbiology.org
Institute for Systems Biology Voice: (206) 732-1397
4225 Roosevelt Way NE, Suite 200 FAX: (206) 732-1260
Seattle, WA 98105-6099 TJ's Location
http://www.systemsbiology.org/





Archive powered by MHonArc 2.6.24.

Top of Page