<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <generator>Persumi - Level up your writing and blogging with AI</generator>
  <category label="Blog" scheme="http://persumi.com/u/fredwu/tech/e/blog" term="blog"/>
  <category label="Tech" scheme="http://persumi.com/u/fredwu/tech" term="tech"/>
  <link href="http://persumi.com/u/fredwu/tech/e/blog/t/timestamps"/>
  <link href="http://persumi.com/u/fredwu/tech/e/blog/t/timestamps/feed/rss"/>
  <link rel="self" href="http://persumi.com/u/fredwu/tech/e/blog/t/timestamps/feed/atom"/>
  <author>
    <name>Fred Wu</name>
    <email>ifredwu@gmail.com</email>
    <uri>http://persumi.com/u/fredwu</uri>
  </author>
  <subtitle/>
  <id>http://persumi.com/u/fredwu/tech/e/blog/t/timestamps</id>
  <title>Blog (timestamps) - Fred Wu&apos;s Tech</title>
  <updated>2026-05-01T20:22:33.223902Z</updated>
  <entry>
    <content type="html">&lt;![CDATA[&lt;p&gt;
It has been &lt;a href=&quot;http://datamapper.lighthouseapp.com/projects/20609/tickets/1245-inconsistent-timestamps-behaviour-when-hard-setting-the-aton-values&quot;&gt;confirmed&lt;/a&gt; by &lt;a href=&quot;http://datamapper.org/&quot;&gt;DataMapper&lt;/a&gt;’s core developer &lt;a href=&quot;http://github.com/snusnu&quot;&gt;Martin Gamsjaeger (snusnu)&lt;/a&gt; that it is a bug.&lt;/p&gt;
&lt;p&gt;
In short, &lt;code class=&quot;inline&quot;&gt;created_[at|on]&lt;/code&gt; can be manually overridden, but &lt;code class=&quot;inline&quot;&gt;updated_[at|on]&lt;/code&gt; cannot.&lt;/p&gt;
&lt;p&gt;
The workaround is simple, do it in two steps, for example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;ruby language-ruby&quot;&gt;job = Job.create(
  title: &quot;Web Developer&quot;,
  created_at: Time.now - 2
)
job.update!(updated_at: Time.now - 1)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Please check the &lt;a href=&quot;http://datamapper.lighthouseapp.com/projects/20609/tickets/1245-inconsistent-timestamps-behaviour-when-hard-setting-the-aton-values&quot;&gt;bug ticket&lt;/a&gt; to see when it’s getting fixed.&lt;/p&gt;
]]&gt;</content>
    <published>2010-04-19T08:22:00.000000Z</published>
    <category label="Blog" scheme="http://persumi.com/u/fredwu/tech/e/blog" term="blog"/>
    <category label="Tech" scheme="http://persumi.com/u/fredwu/tech" term="tech"/>
    <link href="http://persumi.com/u/fredwu/tech/e/blog/p/rails-tip-datamapper-timestamps-bug-and-workaround"/>
    <author>
      <name>Fred Wu</name>
      <email>ifredwu@gmail.com</email>
      <uri>http://persumi.com/u/fredwu</uri>
    </author>
    <id>http://persumi.com/u/fredwu/tech/e/blog/p/rails-tip-datamapper-timestamps-bug-and-workaround</id>
    <title>[Rails Tip] DataMapper Timestamps Bug and Workaround</title>
    <updated>2010-04-19T08:22:00.000000Z</updated>
  </entry>
</feed>