Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisfinne/366422 to your computer and use it in GitHub Desktop.
Save chrisfinne/366422 to your computer and use it in GitHub Desktop.
class Foo < SimpleRecord::Base
has_dates :started_at
end
f1=Foo.create :started_at=>Time.now
sleep(1)
Foo.connection.get_attributes(Foo.table_name, f1.id)[:attributes]['started_at'][0]
=> "2010-04-14T22:24:56"
f2=Foo.create :started_at=>DateTime.now
sleep(1)
Foo.connection.get_attributes(Foo.table_name, f2.id)[:attributes]['started_at'][0]
=> "04/14/2010 03:26 PM"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment