<p>I am running </p>

<ul>
<li>OS X 10.5, </li>
<li>Ruby 1.8.6, </li>
<li>Rails 2.1, </li>
<li>sqlite3-ruby 1.2.2 </li>
</ul>

<p>and I get the following error when trying to rake <code>db:migrate</code> on an app that works find connected to MySQL.</p>

<blockquote>
  <p>rake aborted!
  no such file to load -- sqlite3/database</p>
</blockquote>

[{'answer_id': 11980, 'author': 'lomaxx', 'author_id': 493, 'author_profile': 'https://Stackoverflow.com/users/493', 'pm_score': 1, 'selected': False, 'text': "<p>Personally, I can't see any reason not to store everything in GMT and then use the users local timezone to display the time as it relates to them.</p>\n\n<p>If you want to display relative time, you obviously still need the time and do a translation, but if you do want to do the translation I think GMT is still your best option.</p>\n"}, {'answer_id': 11981, 'author': 'James A. Rosen', 'author_id': 1190, 'author_profile': 'https://Stackoverflow.com/users/1190', 'pm_score': 0, 'selected': False, 'text': '<p>I like storing in GMT and showing only relative ("about 10 seconds ago", "5 months ago").  Users don\'t need to see actual timestamps for most use cases.</p>\n\n<p>There are certainly exceptions, and an individual application might have many of them, so it can\'t be a \'one-true-way\' answer.  Things that need strong audit-ability (e.g. voting), and systems where time is part of the domain of discourse (astronomy, scientific research) might demand true timestamps to be shown to the user.</p>\n\n<p>Most apps, though, are easier to understand with a simple relative time.</p>\n'}, {'answer_id': 11983, 'author': 'Josh', 'author_id': 257, 'author_profile': 'https://Stackoverflow.com/users/257', 'pm_score': 6, 'selected': True, 'text': '<p>You have to store in UTC - if you don\'t, your historic reporting and behaviour during things like Daylight Savings goes... funny.  GMT is a local time, subject to Daylight Savings relative to UTC (which is not).</p>\n\n<p>Presentation to users in different time-zones can be a real bastard if you\'re storing local time.  It\'s easy to adjust to local if your raw data is in UTC - just add your user\'s offset and you\'re done!</p>\n\n<p>Joel talked about this in one of the podcasts (in a round-about way) - he said to <a href="https://stackoverflow.fogbugz.com/default.asp?W12621" rel="noreferrer">store your data in the highest resolution possible</a> (search for \'fidelity\'), because you can always munge it when it goes out again.  That\'s why I say store it as UTC, as local time you need to adjust for anyone who\'s not in that timezone, and that\'s a lot of hard work.  And you need to store whether, for example, daylight savings was in effect when you stored the time.  Yuk.</p>\n\n<p>Often in databases in the past I\'ve stored two - UTC for sorting, local time for display.  That way neither the user nor the computer get confused.</p>\n\n<p>Now, as to display: Sure, you can do the "3 minutes ago" thing, but only if you store UTC - otherwise, data entered in different timezones is going to do things like display as "-4 hours ago", which will freak people out.  If you\'re going to display an actual time, people love to have it in their local time - and if data\'s being entered in multiple timezones you can only do that with ease if you\'re storing UTC.</p>\n'}, {'answer_id': 11987, 'author': 'lomaxx', 'author_id': 493, 'author_profile': 'https://Stackoverflow.com/users/493', 'pm_score': 1, 'selected': False, 'text': "<p>So I ran a little experiment with MSSQL server.</p>\n\n<p>I created a table and added a row with the current localized timezone (Australia).\nThen I changed my datetime to be GMT and added another row.</p>\n\n<p>Even tho those rows were added around 10 seconds apart, they appear in SQL server as tho they're 10 hours apart.</p>\n\n<p>If nothing else, it at least tells me that I should be storing dates in a conisitent manner, which for me, adds weight to the argument for storing them as GMT.</p>\n"}, {'answer_id': 11991, 'author': 'brendan', 'author_id': 225, 'author_profile': 'https://Stackoverflow.com/users/225', 'pm_score': 1, 'selected': False, 'text': "<p>MS Dynamics stores GMT and then at a user level knows your times zone relative to GMT.  Then it displays items to you in your time zone.  </p>\n\n<p>Just thought I'd throw that out there as that's a pretty big group at MS and this is how they decided to handle it.</p>\n"}, {'answer_id': 12020, 'author': 'icco', 'author_id': 1063, 'author_profile': 'https://Stackoverflow.com/users/1063', 'pm_score': 0, 'selected': False, 'text': '<p>I usually just use Unix time. not necessarily future safe, but it works pretty well.</p>\n'}, {'answer_id': 76599, 'author': 'Craig Fisher', 'author_id': 13534, 'author_profile': 'https://Stackoverflow.com/users/13534', 'pm_score': 0, 'selected': False, 'text': '<p>Always store in GMT (or UTC). From there it is easy to convert to any local time zone value.</p>\n'}, {'answer_id': 130998, 'author': 'Bwooce', 'author_id': 15290, 'author_profile': 'https://Stackoverflow.com/users/15290', 'pm_score': 3, 'selected': False, 'text': '<p>Josh is completely correct above, but I have one subtle caveat to explain. This is a case with no correct answer regarding future events and timezones.</p>\n\n<p>Consider the case of a repeating appointment. It occurs at GMT 0000 (for simplicity), which is 1200 NZST (New Zealand Standard Time) and 1000 AEST in Sydney Australia.</p>\n\n<p>When Daylight Savings comes into effect in one zone, what should occur to the appointment? Should it:</p>\n\n<p>1a. If the TZ change is in the zone of\n    the appointment\'s "owner" (who\n    booked it) then attempt to remain at\n    the same desk clock time (eg 10:00am)?<br>\n 1b. If the\n    TZ change is in one of the other\n    meeting attendee\'s zones then no\n    change  </p>\n\n<p>Consequences: It moves for\n    everyone else, unexpectedly, due to\n    the owners TZ change, but it stays\n    "the 10am meeting" as far as the\n    owner is concerned.</p>\n\n<p>\'2. As above, but reversed.</p>\n\n<p>Consequences: It moves for the meeting owner (the 10am meeting becomes the 9am meeting, or v/v), which may be expected but inconvenient. It stays at the same desk clock time for the other attendees until they go through their own TZ transition.</p>\n\n<p>Neither is perfect. Consider the case of two appointments, one booked by Person A that occurs at 10am local time, the other booked by Person B with Person A as an attendee that occurs at 9am. If Person A and Person B are in different TZ\'s then a DST change could easily cause them to become double-booked.</p>\n\n<p>If your mind is a bit bent at this point then I quite understand. </p>\n\n<p>The point behind this example is that to do either of these behaviors properly you need to know not just the UTC version of the local time, but the TZ (and not the offset) that the owner was in when they booked it. Otherwise you have no choice but to take option 2, silently, without even informing anyone that things have changed since GMT times don\'t change and only the presentation changes...right? (no, this is the trap, presentation matters when your 10am meeting moves by itself)</p>\n\n<p>I have to credit my colleague and friend Jason Pollock for this insight. Read <a href="http://blog.jason.pollock.ca/2008/03/timezones-and-future.html" rel="nofollow noreferrer">his view here</a>, and the follow-up discussing <a href="http://blog.jason.pollock.ca/2008/03/ical-how-can-you-do-this-to-me.html" rel="nofollow noreferrer">iCal and VTIMEZONE</a> here.</p>\n'}, {'answer_id': 131209, 'author': 'jpollock', 'author_id': 21977, 'author_profile': 'https://Stackoverflow.com/users/21977', 'pm_score': 4, 'selected': False, 'text': '<p>The answer, as always, is "depends".</p>\n\n<p>It depends on what you are describing with the time, and how the data was provided to you.\nThe key to deciding how to store time values is deciding if you are losing information by dropping the timezone, as well as not surprising your users.</p>\n\n<p>There are definite benefits in storing data in a UTC time_t - it is a single int, allowing quick sorting and easy storage.</p>\n\n<p>I see the problem as being broken down into specific areas:</p>\n\n<ol>\n<li>Historical Data </li>\n<li>Future, Short Term Data </li>\n<li>Future, Long Term Data</li>\n</ol>\n\n<p>With the following subclasses on each:</p>\n\n<ol>\n<li>System Provided</li>\n<li>User Provided</li>\n</ol>\n\n<p>Let\'s look at them one at a time.</p>\n\n<p><strong>System Provided</strong>: I would recommend running systems in UTC, then you avoid the timezone problem and again, no information loss is seen (it\'s always UTC).</p>\n\n<p><strong>Historical Data</strong>: These are things like system log files, process statistics, tracing, comment dates/times, etc.  The data isn\'t going to change, and the timezone descriptor isn\'t going to change retroactively.  For this type of data, there is no information lost by storing the information in UTC regardless of the timezone it was provided in.  So, drop the timezone.</p>\n\n<p><strong>Future, Long Term Data</strong>: These are events that are either far enough in the future or will keep happening.  If they are kept around long enough, the timezone descriptors are guaranteed change.  A good example of this type of data is, "The Weekly Management Meeting".  This is data that is entered once, and expected to keep working into perpetuity.  For these values, it is important to determine if it is system or user provided.  For user-provided data, the time should be stored with the creator\'s timezone, anything else results in information loss.  This information loss becomes apparent when the timezone definition changes and the time is displayed to the creator as having an entirely different value!  </p>\n\n<p>As Bwooce has indicated, there is some confusion where the creator and viewer are in different timezones.  In that case, I would expect the application to indicate which time values have moved due to a timezone shift from their previous locations.</p>\n\n<p><strong>Future, Short Term Data</strong>: This is data that is quickly going to become historical, or is only valid for a short period of time.  Examples could be interval timers, rating transitions, etc.  For this data, since the likelihood is low that the definition will change between the creation of the value and the time it becomes historical, it might be possible to get away with dropping the timezone.  However, I have found that these values have a bad habit of becoming "Future, Long Term Data".</p>\n\n<p>Once you have decided to store the timezone, care must be taken with how it is stored.  </p>\n\n<ul>\n<li>Don\'t store the timezone as an offset, or the full descriptor.</li>\n</ul>\n\n<p>If you store a timezone as an offset, what do you do if the timezone changes?  Do you go through the system and do a blanket change on the existing data?  If you do, you\'ve now made any historical values incorrect.  Good examples of this fault are Oracle and iCal.  Oracle stores timezone information as an offset from UTC, and iCal includes the full descriptor for the creation timezone.</p>\n\n<ul>\n<li>Do store it as a name.</li>\n</ul>\n\n<p>This allows the definition of the timezone to change without having to modify the existing values you have.  It does make sorting more difficult, since any index that is generated may be invalid if the timezone data changes.</p>\n\n<p>If developers continue to store everything in UTC, irrespective of timezone, we will continue to see the problems that we\'ve seen with the last batch of timezone changes.</p>\n\n<p>At one organisation, the secretaries had to print out the calendars for their teams before the daylight savings date, and then print them out again after the change.  Finally, they compared the two and re-created all of the appointments that had moved.  Of course, they missed several, and there were several weeks of pain until the old daylight savings date was reached and the times became correct again.</p>\n'}, {'answer_id': 207659, 'author': 'maletin', 'author_id': 27239, 'author_profile': 'https://Stackoverflow.com/users/27239', 'pm_score': 1, 'selected': False, 'text': '<p>i prefer to store everything with the timezone.\nthe client can decide, which way it should be presented later.\nmy favorite library for converting is the <a href="http://www.postgresql.org/docs/8.3/interactive/functions-datetime.html" rel="nofollow noreferrer">PostgreSQL-Database</a>.</p>\n'}, {'answer_id': 1104356, 'author': 'Rick', 'author_id': 78247, 'author_profile': 'https://Stackoverflow.com/users/78247', 'pm_score': 2, 'selected': False, 'text': '<p>Storing everything in GMT/UTC seems most logical to me. You can then show the date and time in every timezone you want.</p>\n\n<p>A few ceveats:</p>\n\n<ol>\n<li>If a time is only specified as a\nwall clock time and that is the\nleading representation, then it is\nnot an absolutely specified time.\nYou should (and cannot) convert it\nin any GMT representation. E.G. 9:00\nAM every morning. In other words:\nthis is no (date)time.</li>\n<li>If you\n    save a date and time of a future\n    appointment, you should use the\n    offset to GMT specified by the input\n    timezone and the <em>the moment in time\n    itself</em>. So if it is an appointment\n    in summer made in winter in e.g.\n    western europe, it is +2:00,\n    allthough the normal (winter time)\n    offset is +1:00. This will solve the\n    calender problem that Bwooce\n    mentioned. </li>\n<li>Of course, the same\nthat applies to using the right\noffset while converting to GMT\napplies when converting back to a\ndate and time in any particular\ntimezone.</li>\n</ol>\n\n<p>Luckily, when used correctly, the (.NET) DateTime type takes care of all the gory details of keeping calendars etc. for you and all of this should be very easy when you know how it works. </p>\n'}, {'answer_id': 12493673, 'author': 'HKalsi', 'author_id': 1042411, 'author_profile': 'https://Stackoverflow.com/users/1042411', 'pm_score': 1, 'selected': False, 'text': '<p>Have a look here, the w3c have done an excellent job answering the question.</p>\n\n<p>Look at the use cases.</p>\n\n<p><a href="http://www.w3.org/TR/timezone/" rel="nofollow">http://www.w3.org/TR/timezone/</a></p>\n\n<p>Note that they recommend storing datetimes as UTC not GMT, GMT is subject to daylight savings time.</p>\n'}, {'answer_id': 54834663, 'author': 'Jacob', 'author_id': 1076894, 'author_profile': 'https://Stackoverflow.com/users/1076894', 'pm_score': 0, 'selected': False, 'text': "<p>Dates should be stored as UTC UNLESS it is user provided data and you CANNOT know what timezone the user intended that data to be in. Sometimes (very very rarely) you need to just store the hour, minute, second, day, month and year components without any timezone so you can spit it out back to the user. Now for new developers or if you're unsure, store UTC and you will be 99% correct.</p>\n\n<p>But don't be fooled by believing this works 100% of the time for all cases all the time. It does not.</p>\n"}]
['https://Stackoverflow.com/questions/11986', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1396/']