Topic: Rails creating weird dates.
I'm following a tutorial from a book called Beginning Rails 3. It's a blog program. It creates an articles table with datetime attributes like published_at, updated_at, created_at.
There is an exercise in the book to use rails console and to create a new Article to be inserted into the articles database. For the three datetime fields it sets the value which is returned by Date.today. Now my computer's current time is 7:24pm and the date is 2012-03-25 but this is the Article object it inserts upon article.save (notice the times and dates):
INSERT INTO `articles` (`body`, `created_at`, `excerpt`, `location`, `published_at`, `title`, `updated_at`) VALUES ('SQL stands for Structured Query Language', '2012-03-26 00:15:05', NULL, NULL, '2012-03-25 05:00:00', 'Introduction to SQL', '2012-03-26 00:15:05')
Now I have no idea where it got those times from and why there are even two different times. All three fields are of type datetime.
When I run Date.today in the console it returns the correct date (Sun, 25 Mar 2012)
Can anyone help?