On Apr 5, 2012, at 9:32 AM, Jeremy Evans wrote:

> Tom Wardrop brought to my attention yesterday that the default timestamp 
> format that Sequel uses may not always work correctly on Microsoft SQL 
> Server, depending on locale.  However, with a slight change in the format, 
> supposedly Microsoft SQL Server will always handle things correctly, 
> regardless of the locale.  The change in the format is just using a T instead 
> of a space between the date and time.  You can use the following code to test 
> on your system:
> 
>   DB.extend_datasets{def default_timestamp_format() "'%Y-%m-%dT%H:%M:%S%N%z'" 
> end}
> 
> where DB is your Sequel::Database instance. I'm considering making this 
> format the default for Microsoft SQL Server, but would like some feedback 
> from other Microsoft SQL Server users to make sure it doesn't break anything. 
>  I've tested it on SQL Server 2008, and didn't experience regressions, but 
> more tests would be appreciated.
> 
> Thanks,
> Jeremy


We've been using this format string for some time without any problems on SQL 
Server 2005 and 2008. Sorry we never made a pull request!  :)
Also, you might need to consider date format as well

        def literal_date(v)
          v.strftime("'%Y%m%d'")
        end


official info here
http://msdn.microsoft.com/en-us/library/ms180878.aspx#StringLiteralDateandTimeFormats

Cheers,
Mike

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to