--- migrate_from_trac.rake.old	2010-08-19 16:35:22.000000000 +0200
+++ migrate_from_trac.rake	2010-08-19 16:35:45.000000000 +0200
@@ -93,7 +93,7 @@
         # If this attribute is set a milestone has a defined target timepoint
         def due
           if read_attribute(:due) && read_attribute(:due) > 0
-            Time.at(read_attribute(:due)).to_date
+            Time.at(read_attribute(:due) / 1000000).to_date
           else
             nil
           end
@@ -101,7 +101,7 @@
         # This is the real timepoint at which the milestone has finished.
         def completed
           if read_attribute(:completed) && read_attribute(:completed) > 0
-            Time.at(read_attribute(:completed)).to_date
+            Time.at(read_attribute(:completed) / 1000000).to_date
           else
             nil
           end
@@ -121,7 +121,7 @@
         set_table_name :attachment
         set_inheritance_column :none
 
-        def time; Time.at(read_attribute(:time)) end
+        def time; Time.at(read_attribute(:time) / 1000000) end
 
         def original_filename
           filename
@@ -182,14 +182,14 @@
           read_attribute(:description).blank? ? summary : read_attribute(:description)
         end
 
-        def time; Time.at(read_attribute(:time)) end
-        def changetime; Time.at(read_attribute(:changetime)) end
+        def time; Time.at(read_attribute(:time) / 1000000) end
+        def changetime; Time.at(read_attribute(:changetime) / 1000000) end
       end
 
       class TracTicketChange < ActiveRecord::Base
         set_table_name :ticket_change
 
-        def time; Time.at(read_attribute(:time)) end
+        def time; Time.at(read_attribute(:time) / 1000000) end
       end
 
       TRAC_WIKI_PAGES = %w(InterMapTxt InterTrac InterWiki RecentChanges SandBox TracAccessibility TracAdmin TracBackup TracBrowser TracCgi TracChangeset \
@@ -214,7 +214,7 @@
           super.select {|column| column.name.to_s != 'readonly'}
         end
 
-        def time; Time.at(read_attribute(:time)) end
+        def time; Time.at(read_attribute(:time) / 1000000) end
       end
 
       class TracPermission < ActiveRecord::Base
