File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -259,6 +259,28 @@ impl fmt::Debug for Instant {
259259} 
260260
261261impl  SystemTime  { 
262+     /// An anchor in time which can be used to create new `SystemTime` instances or 
263+ /// learn about where in time a `SystemTime` lies. 
264+ /// 
265+ /// This constant is defined to be "1970-01-01 00:00:00 UTC" on all systems with 
266+ /// respect to the system clock. Using `duration_since` on an existing 
267+ /// `SystemTime` instance can tell how far away from this point in time a 
268+ /// measurement lies, and using `UNIX_EPOCH + duration` can be used to create a 
269+ /// `SystemTime` instance to represent another fixed point in time. 
270+ /// 
271+ /// # Examples 
272+ /// 
273+ /// ```no_run 
274+ /// use std::time::SystemTime; 
275+ /// 
276+ /// match SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) { 
277+ ///     Ok(n) => println!("1970-01-01 00:00:00 UTC was {} seconds ago!", n.as_secs()), 
278+ ///     Err(_) => panic!("SystemTime before UNIX EPOCH!"), 
279+ /// } 
280+ /// ``` 
281+ #[ unstable( feature = "assoc_unix_epoch" ,  issue = "49502" ) ]  
282+     pub  const  UNIX_EPOCH :  SystemTime  = UNIX_EPOCH ; 
283+ 
262284    /// Returns the system time corresponding to "now". 
263285/// 
264286/// # Examples 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments