Skip to content

Instantly share code, notes, and snippets.

@salgadobreno
Created March 25, 2011 01:19
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 salgadobreno/886203 to your computer and use it in GitHub Desktop.
Save salgadobreno/886203 to your computer and use it in GitHub Desktop.
#e is the Event.first
#I just can't understand whats going on...
#first date is Sat, 01 Jan
#after saving it becomes Sun, 31 Dec
#after re-retrieving the same record its Fri, 31 Dec
#WHATS GOING ON HERE?!
irb(main):088:0> date = Date.civil(01,01,01)
=> Sat, 01 Jan 0001
irb(main):090:0> e.start_at = date
=> Sat, 01 Jan 0001
irb(main):091:0> e.save
=> true
irb(main):092:0> e.start_at
=> Sun, 31 Dec 0000 22:53:32 LMT -03:06
irb(main):093:0> Event.first.start_at
=> Fri, 31 Dec 0000 22:53:32 LMT -03:06
irb(main):094:0>
irb(main):094:0> Event.first
=> #<Event id: 1, name: "e1", start_at: "0001-01-01 02:00:00", end_at: "0001-01-01 02:00:00", created_at: "2011-03-24 22
:37:36", updated_at: "2011-03-25 00:49:52", description: nil, user_id: nil>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment