<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -79,7 +79,8 @@ if Object.const_defined?(:DateTime)
       def mock_time
         t_now = Time.mock_time
         return nil if t_now.nil?
-        DateTime.new(t_now.year, t_now.month, t_now.day, t_now.hour, t_now.min, t_now.sec)
+        offset = Rational(t_now.utc_offset, 60 * 60 * 24)
+        DateTime.new(t_now.year, t_now.month, t_now.day, t_now.hour, t_now.min, t_now.sec, offset)
       end
 
       # Alias the original now</diff>
      <filename>lib/timecop/time_extensions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -132,7 +132,11 @@ class Timecop
         
     def parse_travel_args(*args) #:nodoc:
       arg = args.shift
-      if arg.is_a?(Time) || (Object.const_defined?(:DateTime) &amp;&amp; arg.is_a?(DateTime))
+      if arg.is_a?(Time)
+        arg = arg.getlocal
+        year, month, day, hour, minute, second = arg.year, arg.month, arg.day, arg.hour, arg.min, arg.sec
+      elsif Object.const_defined?(:DateTime) &amp;&amp; arg.is_a?(DateTime)
+        arg = arg.new_offset(DateTime.now_without_mock_time.offset)
         year, month, day, hour, minute, second = arg.year, arg.month, arg.day, arg.hour, arg.min, arg.sec
       elsif Object.const_defined?(:Date) &amp;&amp; arg.is_a?(Date)
         year, month, day, hour, minute, second = arg.year, arg.month, arg.day, 0, 0, 0</diff>
      <filename>lib/timecop/timecop.rb</filename>
    </modified>
    <modified>
      <diff>@@ -67,16 +67,16 @@ class TestTimecop &lt; Test::Unit::TestCase
     t = Time.local(2008, 10, 10, 10, 10, 10)
     Timecop.freeze(t) do 
       assert_equal t, Time.now
-      assert_equal DateTime.new(2008, 10, 10, 10, 10, 10), DateTime.now
+      assert_equal DateTime.new(2008, 10, 10, 10, 10, 10, local_offset), DateTime.now
       assert_equal Date.new(2008, 10, 10), Date.today
     end
     assert_not_equal t, Time.now
-    assert_not_equal DateTime.new(2008, 10, 10, 10, 10, 10), DateTime.now
+    assert_not_equal DateTime.new(2008, 10, 10, 10, 10, 10, local_offset), DateTime.now
     assert_not_equal Date.new(2008, 10, 10), Date.today
   end
   
   def test_freeze_with_datetime_instance_works_as_expected
-    t = DateTime.new(2008, 10, 10, 10, 10, 10)
+    t = DateTime.new(2008, 10, 10, 10, 10, 10, local_offset)
     Timecop.freeze(t) do 
       assert_equal t, DateTime.now
       assert_equal Time.local(2008, 10, 10, 10, 10, 10), Time.now
@@ -92,18 +92,18 @@ class TestTimecop &lt; Test::Unit::TestCase
     Timecop.freeze(d) do
       assert_equal d, Date.today
       assert_equal Time.local(2008, 10, 10, 0, 0, 0), Time.now
-      assert_equal DateTime.new(2008, 10, 10, 0, 0, 0), DateTime.now
+      assert_equal DateTime.new(2008, 10, 10, 0, 0, 0, local_offset), DateTime.now
     end
     assert_not_equal d, Date.today
     assert_not_equal Time.local(2008, 10, 10, 0, 0, 0), Time.now
-    assert_not_equal DateTime.new(2008, 10, 10, 0, 0, 0), DateTime.now    
+    assert_not_equal DateTime.new(2008, 10, 10, 0, 0, 0, local_offset), DateTime.now    
   end
   
   def test_freeze_with_integer_instance_works_as_expected
     t = Time.local(2008, 10, 10, 10, 10, 10)
     Timecop.freeze(t) do
       assert_equal t, Time.now
-      assert_equal DateTime.new(2008, 10, 10, 10, 10, 10), DateTime.now
+      assert_equal DateTime.new(2008, 10, 10, 10, 10, 10, local_offset), DateTime.now
       assert_equal Date.new(2008, 10, 10), Date.today
       Timecop.freeze(10) do
         assert_equal t + 10, Time.now
@@ -155,6 +155,35 @@ class TestTimecop &lt; Test::Unit::TestCase
     end
   end
   
+  def test_freeze_with_datetime_on_specific_timezone
+    each_timezone do
+      t = DateTime.parse(&quot;2009-10-11 00:38:00 +0200&quot;)
+      assert_equal &quot;+02:00&quot;, t.zone
+      Timecop.freeze(t) do
+        assert_equal t, DateTime.now
+      end
+    end
+  end
+
+  def test_mocked_date_time_now_is_local
+    each_timezone do
+      t = DateTime.parse(&quot;2009-10-11 00:38:00 +0200&quot;)
+      Timecop.freeze(t) do
+        assert_equal local_offset, DateTime.now.offset
+      end
+    end
+  end
+  
+  def test_freeze_with_utc_time
+    each_timezone do
+      t = Time.utc(2008, 10, 10, 10, 10, 10)
+      local = t.getlocal
+      Timecop.freeze(t) do
+        assert_equal local, Time.now
+      end
+    end
+  end
+  
   def test_recursive_rebasing_maintains_each_context
     t = Time.local(2008, 10, 10, 10, 10, 10)
     Timecop.travel(2008, 10, 10, 10, 10, 10) do 
@@ -218,13 +247,31 @@ class TestTimecop &lt; Test::Unit::TestCase
     assert times_effectively_equal(t_real, t_return)
   end
 
+  private
 
-private
-
-  # Tests to see that two times are within the given distance,
-  # in seconds, from each other.
-  def times_effectively_equal(time1, time2, seconds_interval = 1)
-    (time1.to_i - time2.to_i).abs &lt;= seconds_interval
-  end
+    # Tests to see that two times are within the given distance,
+    # in seconds, from each other.
+    def times_effectively_equal(time1, time2, seconds_interval = 1)
+      (time1.to_i - time2.to_i).abs &lt;= seconds_interval
+    end
     
+    def local_offset
+      DateTime.now_without_mock_time.offset
+    end
+  
+    TIMEZONES = [&quot;Europe/Paris&quot;, &quot;UTC&quot;, &quot;EDT&quot;]
+  
+    def each_timezone
+      old_tz = ENV[&quot;TZ&quot;]
+    
+      begin
+        TIMEZONES.each do |timezone|
+          ENV[&quot;TZ&quot;] = timezone
+          yield
+        end
+      ensure
+        ENV[&quot;TZ&quot;] = old_tz
+      end
+    end
+  
 end
\ No newline at end of file</diff>
      <filename>test/test_timecop.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>744ebd4491f8394231193fcd90cd8fb063b9178c</id>
    </parent>
  </parents>
  <author>
    <name>piglop</name>
    <email>mike@lepton.fr</email>
  </author>
  <url>http://github.com/piglop/timecop/commit/d74af87729f8488fad2344e40810928216228702</url>
  <id>d74af87729f8488fad2344e40810928216228702</id>
  <committed-date>2009-10-24T12:35:14-07:00</committed-date>
  <authored-date>2009-10-18T09:39:37-07:00</authored-date>
  <message>DateTime.now returns true local time, and Timecop.freeze accepts UTC Time

Signed-off-by: John Trupiano &lt;jtrupiano@gmail.com&gt;</message>
  <tree>a93d8afbbcaf609aa1648a1af493dd895e2525db</tree>
  <committer>
    <name>John Trupiano</name>
    <email>jtrupiano@gmail.com</email>
  </committer>
</commit>
