[freetds] Out-of-the-box "date format" values for "default" and "en_US" locales

matthew.green at datamartcomputing.com matthew.green at datamartcomputing.com
Thu Apr 16 02:44:01 EDT 2015


Hi Geoff,

It is confusing, as you suggest. The part I noted in the link I sent was this "dd mmm yyyy hh:nn:ss:sss (24 hour clock, Europe default + milliseconds, 4-digit year)". The word default struck me but it does seem ambiguous as it says Europe default + milliseconds so the default part could be referring to the 24 hour clock or to the format of the whole thing.

Yes, you're right that from isql you don't get to see milliseconds by default, the same with the GUI. Having now given it a little more thought I suppose the lesson is that you should specify the format you want and not rely on defaults :-)

Incidentally MS SQL Server 2012 (probably other versions too) display the milliseconds with a full stop by default but you get a colon if you use the select I gave in my example.

So, I suppose a full stop by default shouldn't cause any controversy. As for locales.conf.. that I don't know.

Cheers,

Matthew.


April 16 2015 12:47 AM, "Geoff Montee" <geoff.montee at gmail.com> wrote:
> Hi Matthew,
> 
> On Mon, Apr 13, 2015 at 11:48 PM, <matthew.green at datamartcomputing.com> wrote:
> 
>> The vendor (Sybase) default seems to be with a colon
>> 
> (http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc38151.1520/html/iqrefbb/
>> onvert.htm).
>> 
>> select convert(char(40),getdate(),109);
>> 
>> ----------------------------------------
>> Apr 14 2015 8:42:03:660AM
>> 
>> Shouldn't we stick to that?
> 
> In the page that you linked, I see that the format style you mention
> is #9 or #109, but I don't see anything to indicate that it is the
> "default." The default style for the convert function in Sybase ASE
> 16.0 appears to use style "100", which omits the milliseconds
> entirely.
> 
> http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36271.1600/doc/html/san13
> 3050437990.html
> 
> The documentation also says that there should be a dot, not a colon,
> between the seconds and microseconds by default for the "bigdatetime"
> type:
> 
> http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36271.1600/doc/html/san13
> 3050393286.html
> 
> http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36271.1600/doc/html/san13
> 3050394051.html
> 
> Confusingly, it seems to use a colon by default for the "time" type:
> 
> http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36271.1600/doc/html/san13
> 3050395880.html
> 
> On another note, FreeTDS's documentation page for locales.conf says this:
> 
> http://www.freetds.org/userguide/locales.htm
> 
> "locales.conf will probably be dropped from FreeTDS one day. Its only
> real purpose now is to control the format of date strings. The Right
> Way™ to deduce the appropriate default date format is from the
> application's locale settings, while allowing an override in
> freetds.conf. That's the direction we're headed."
> 
> Has any thought been given to how date formatting should be handled
> after locales.conf goes away?
> 
> Thanks,
> 
> Geoff
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds


More information about the FreeTDS mailing list