At 11:04 PM 9/11/2011, Mark Rotteveel wrote:
>On Wed, 09 Nov 2011 09:59:23 -0000, "tomsee7" <tomconl...@gmail.com>
>wrote:
>> Also, '30-Jun-2011 08:35:26' is explicit and unambiguous.
>
>Is it? 

Yes.  As is '11/06/2011' - as the OP picked up from my *typo*. That is valid 
for dates in the US (mmddccyy) date format. '11.06.2011' is used for the 
International English (ddmmccyy)date format.  

>Technically it is locale-dependent conversion as well. 

Technically it's not.  It's not locale-dependent and it's not (in most 
contexts) a conversion but encoding of recognised literal formats. The fact 
that it uses English abbreviations for calendar months is not due to locale but 
to a xenophobic implementation.

>I am not sure if Firebird supports this US-locale conversion in all locales, 
>and you would also need to make sure that your application will behave in all
>locales it will run in and supply a correctly formatted string.

Firebird doesn't support "locale conversion" at all.  It takes what you give it 
and rejects it if it has a rule that says it's invalid.

>Even better of course would be to simply use a parametrized query which
>assigns a timestamp value (eg java.sql.Timestamp in JDBC), instead of using
>string conversions.

Definitely parameters are best practice for date/time literals.  Don't call the 
literal encoding "string conversion", though.

./heLen



Reply via email to