Module: SQLServerDBI::Timestamp

Defined in:
lib/core_ext/dbi.rb

Instance Method Summary collapse

Instance Method Details

#to_sqlserver_stringObject

Deprecated DBI. See documentation for Type::SqlserverTimestamp which this method tries to mimic as ODBC is still going to convert SQL Server milliconds to whole number representation of nanoseconds.



8
9
10
11
# File 'lib/core_ext/dbi.rb', line 8

def to_sqlserver_string
  datetime, nanoseconds = to_s.split('.')
  "#{datetime}.#{sprintf("%03d",nanoseconds.to_i/1000000)}"
end