Skip to content

Commit

Permalink
expand Documentation about the GzHeader datetime method
Browse files Browse the repository at this point in the history
  • Loading branch information
nivkner committed Apr 18, 2017
1 parent 4596fcb commit e0715cc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/gz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -864,8 +864,14 @@ impl Header {
self.mtime
}

/// Returns the most recent modification time as a datetime if time stamp is available.
pub fn datetime(&self) -> Option<time::SystemTime> {
/// Returns the most recent modification time represented by a date-time type.
/// Returns `None` if the value of the underlying counter is 0,
/// indicating no time stamp is available.
///
///
/// The time is measured as seconds since 00:00:00 GMT, Jan. 1 1970.
/// See [`mtime`](#method.mtime) for more detail.
pub fn mtime_as_datetime(&self) -> Option<time::SystemTime> {
if self.mtime == 0 {
None
} else {
Expand Down

0 comments on commit e0715cc

Please sign in to comment.