<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,7 +2,7 @@ Here's the pseudo-BNF for timespecs. If you think a shortcut is missing, let me
 know!
 
 
-timespec = time [date] | [now] + count units
+timespec = time [zulu] [date] | [now] + count units
 units    = seconds | minutes | hours | days | weeks | months | years
 time     = ( [H]H[MM[.SS]] | [H]H[:MM[.SS]] ) [am|pm] | 
            midnight | noon | teatime</diff>
      <filename>README.timespec</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@ module AtTime
     end
     seconds = $8 or '00'
 
-    Time.mktime(year,$3,$4,$5,$6,seconds,0)
+    Time.mktime(year,$3,$4,$5,$6,seconds)
   end
 
   # timespec = time [date] | [now] + count units
@@ -62,20 +62,26 @@ module AtTime
         Time.local(*ary)
       end
     else
-      # time [date]
+      # time [zulu] [date]
       h,mi,s,str = parse_time(str)
       now = Time.now
+      z = false
+      if str.strip =~ /^(z(u(l(u)?)?)?)(.*)/
+        z = true
+        str = $5.strip
+      end
       if str.strip == &quot;&quot;
         y,mo,d = [now.year, now.month, now.day]
-        t = Time.mktime(y,mo,d,h,mi,s,0)
-        if t - Time.now &lt; 0
+        t = Time.mktime(y,mo,d,h,mi,s)
+        while t - Time.now &lt; 0
           t += 60*60*24
         end
-        t
       else
         y,mo,d = parse_date(str)
-        t = Time.mktime(y,mo,d,h,mi,s,0)
+        t = Time.mktime(y,mo,d,h,mi,s)
       end
+      t += t.utc_offset if z
+      t
     end
   end
 
@@ -83,14 +89,14 @@ module AtTime
   def self.parse_time(str)
     h = m = s = nil
     str.strip!
-    if str =~ /^(\d?\d)(\:?(\d\d)(\.(\d+))?)?\s*(am?|pm?)?(\s|$)(.*)/i
+    if str =~ /^(\d?\d)(\:?(\d\d)(\.(\d+))?)?\s*(am?|pm?)?(([\sz]|$).*)/i
       h = $1.to_i
       m = s = 0
       if $2
         m = $3.to_i
         s = ($5 ? $5.to_i : 0)
       end
-      str = $8 or &quot;&quot;
+      str = $7 or &quot;&quot;
       h += 12 if $6 =~ /^p/i and h &lt;= 12
     elsif 'midnight' =~ /^#{str}/i
       h,m,s = [0,0,0]
@@ -102,7 +108,7 @@ module AtTime
       h,m,s = [16,0,0]
       str = str[$&amp;.size..-1]
     else
-      raise ParseError, &quot;Invalid time.&quot;
+      raise ParseError, &quot;Invalid time '#{str}'.&quot;
     end
     return [h,m,s,str]
   end</diff>
      <filename>lib/at_time.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 require 'test/unit'
 require 'at_time'
 
+# See README.timespec
 class TestAtTime &lt; Test::Unit::TestCase
-  # hms is [hours, minutes, seconds]
   def assert_time(t1, t2)
     assert_equal t1.hour, t2.hour
     assert_equal t1.min, t2.min
@@ -19,7 +19,6 @@ class TestAtTime &lt; Test::Unit::TestCase
     $now = Time.now
   end
 
-  # time = [H]HMM[.SS] [am|pm] | [H]H:MM[.SS] [am|pm] | midnight | noon | teatime
   def test_parse_time
     assert_equal [0,0,0,''], AtTime.parse_time('midnight')
     assert_equal [12,0,0,''], AtTime.parse_time('noon')
@@ -32,7 +31,6 @@ class TestAtTime &lt; Test::Unit::TestCase
     assert_equal [23,0,0,''], AtTime.parse_time('11pm')
   end
 
-  # date = month-name day | DD.MM.YY[YY] | MM/DD/YY[YY] | MMDDYY[YY] | today | tomorrow
   def test_parse_date
     assert_equal [$now.year,2,21], AtTime.parse_date('February 21')
     assert_equal [$now.year,2,21], AtTime.parse_date('feb 21')
@@ -47,7 +45,6 @@ class TestAtTime &lt; Test::Unit::TestCase
     assert_equal [w.year, w.month, w.day], AtTime.parse_date(wday_name)
   end
 
-  # timespec = time [date] | [now] + count units
   def test_parse_timespec
     assert_time $now, AtTime.parse_timespec($now.strftime(&quot;%H%M.%S&quot;))
     assert_datetime $now, AtTime.parse_timespec($now.strftime(&quot;%H%M.%S %d.%m.%Y&quot;))
@@ -55,6 +52,9 @@ class TestAtTime &lt; Test::Unit::TestCase
     assert_equal (Time.now + 5*60).min, AtTime.parse_timespec('now + 5 min').min
     assert_equal (Time.now + 5*60).min, AtTime.parse_timespec('+5').min
     assert_equal 3, AtTime.parse_timespec('255pm wed').wday
+    offset = Time.zone_offset($now.zone)
+    u = $now - offset
+    assert_equal $now.hour, AtTime.parse_timespec(u.strftime(&quot;%H%Mz&quot;)).hour
   end
 
   # POSIX = [[CC]YY]MMDDhhmm[.SS]</diff>
      <filename>test/test_at_time.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ffebe24f19e98b21e9f225a549af27e32c866ae3</id>
    </parent>
  </parents>
  <author>
    <name>Hans Fugal</name>
    <email>hans@fugal.net</email>
  </author>
  <url>http://github.com/fugalh/creme/commit/14163769f1a04a8ad28830bd5e52e24760fca86b</url>
  <id>14163769f1a04a8ad28830bd5e52e24760fca86b</id>
  <committed-date>2008-02-26T08:42:59-08:00</committed-date>
  <authored-date>2008-02-26T08:42:59-08:00</authored-date>
  <message>zulu</message>
  <tree>379dd066498d31f4de476834ccf6a2761adfcad3</tree>
  <committer>
    <name>Hans Fugal</name>
    <email>hans@fugal.net</email>
  </committer>
</commit>
