buildrelease
[openafs-wiki.git] / TWiki / TWikiTimeDotPm.mdwn
index 9472014..bed7498 100644 (file)
@@ -5,7 +5,7 @@ Time handling functions.
 <div>
   <ul>
     <li><a href="#Package =TWiki::Time="> Package TWiki::Time</a><ul>
-        <li><a href="#StaticMethod <strong>parseTime</strong> ($szDat"> StaticMethod parseTime <tt>($szDate) -&gt; $iSecs</tt></a></li>
+        <li><a href="#StaticMethod <strong>parseTime</strong> ($szDat"> StaticMethod parseTime <tt>($szDate,$defaultLocal) -&gt; $iSecs</tt></a></li>
         <li><a href="#StaticMethod <strong>formatTime</strong> ($epoc"> StaticMethod formatTime <tt>($epochSeconds,$formatString,$outputTimeZone) -&gt; $value</tt></a></li>
         <li><a href="#StaticMethod <strong>formatDelta</strong> ($s)"> StaticMethod formatDelta <tt>($s) -&gt; $string</tt></a></li>
         <li><a href="#StaticMethod <strong>parseInterval</strong> ($s"> StaticMethod parseInterval <tt>($szInterval) -&gt; [$iSecs,$iSecs]</tt></a></li>
@@ -14,9 +14,9 @@ Time handling functions.
   </ul>
 </div>
 
-## <a name="StaticMethod &lt;strong&gt;parseTime&lt;/strong&gt; ($szDat"></a> [[StaticMethod]] **parseTime** `($szDate) -> $iSecs`
+## <a name="StaticMethod &lt;strong&gt;parseTime&lt;/strong&gt; ($szDat"></a> [[StaticMethod]] **parseTime** `($szDate,$defaultLocal) -> $iSecs`
 
-Convert string date/time to seconds since epoch.
+Convert string date/time string to seconds since epoch (1970-01-01T00:00:00Z).
 
 - `$sDate` - date/time string
 
@@ -27,10 +27,14 @@ Handles the following formats:
 - 2001.12.31.23.59.59
 - 2001/12/31 23:59
 - 2001.12.31.23.59
-- 2001-12-31T23:59:59Z
+- 2001-12-31T23:59:59
+
+ISO dates may have a timezone specifier, either Z or a signed difference in hh:mm format. For example:
+
 - 2001-12-31T23:59:59+01:00
 - 2001-12-31T23:59Z
-- 2001-12-31T23:59+01:00
+
+The default timezone is Z, unless $defaultLocal is true in which case the local timezone will be assumed.
 
 If the date format was not recognised, will return 0.
 
@@ -138,7 +142,7 @@ nameOfDuration may be one of:
 - 2001-01-01T00:00:00
 - 2001-12-31T23:59:59
 
-timezone is optional and not supported yet.
+timezone is optional. Default is local time.
 
 If the format is not recognised, will return empty interval [0,0].