@@ -25,32 +25,51 @@ use web_time::{SystemTime, UNIX_EPOCH};
2525#[ cfg( feature = "sys" ) ]  
2626pub  struct  Temporal ; 
2727
28- #[ cfg( feature = "sys" ) ]  
2928impl  Temporal  { 
3029    /// Get a `Now` object for the default host system. 
31- pub  fn  now ( )  -> Now < DefaultHostSystem >  { 
32-         Now :: new ( DefaultHostSystem ) 
30+ #[ cfg( feature = "sys-local" ) ]  
31+     #[ deprecated(  
32+         since = "0.1.0" ,  
33+         note = "`now` deprecated was not clear about the host system implementation, please use `local_now`"  
34+     ) ]  
35+     pub  fn  now ( )  -> Now < LocalHostSystem >  { 
36+         Now :: new ( LocalHostSystem ) 
37+     } 
38+ 
39+     /// Get a `Now` object with a [`LocalHostSystem`], which 
40+ /// will use the host system's time zone as a fallback. 
41+ #[ cfg( feature = "sys-local" ) ]  
42+     pub  fn  local_now ( )  -> Now < LocalHostSystem >  { 
43+         Now :: new ( LocalHostSystem ) 
44+     } 
45+ 
46+     /// Get a `Now` object with a [`UtcHostSystem`], which 
47+ /// will use a UTC time zone as a fallback. 
48+ #[ cfg( feature = "sys" ) ]  
49+     pub  fn  utc_now ( )  -> Now < UtcHostSystem >  { 
50+         Now :: new ( UtcHostSystem ) 
3351    } 
3452} 
3553
36- /// A default host system implementation 
54+ /// A UTC host system implementation that will return the current time 
55+ /// with the a UTC time zone as fallback. 
3756/// 
38- /// This implementation is backed by [`SystemTime`] and [`iana_time_zone`]  
57+ /// This implementation is backed by [`std::time:: SystemTime`].  
3958#[ cfg( feature = "sys" ) ]  
40- pub  struct  DefaultHostSystem ; 
59+ pub  struct  UtcHostSystem ; 
4160
4261#[ cfg( feature = "sys" ) ]  
43- impl  HostHooks  for  DefaultHostSystem  { } 
62+ impl  HostHooks  for  UtcHostSystem  { } 
4463
4564#[ cfg( feature = "sys" ) ]  
46- impl  HostClock  for  DefaultHostSystem  { 
65+ impl  HostClock  for  UtcHostSystem  { 
4766    fn  get_host_epoch_nanoseconds ( & self )  -> TemporalResult < EpochNanoseconds >  { 
4867        get_system_nanoseconds ( ) 
4968    } 
5069} 
5170
5271#[ cfg( feature = "sys" ) ]  
53- impl  HostTimeZone  for  DefaultHostSystem  { 
72+ impl  HostTimeZone  for  UtcHostSystem  { 
5473    fn  get_host_time_zone ( 
5574        & self , 
5675        provider :  & impl  timezone_provider:: provider:: TimeZoneProvider , 
@@ -59,7 +78,34 @@ impl HostTimeZone for DefaultHostSystem {
5978    } 
6079} 
6180
62- #[ cfg( feature = "sys" ) ]  
81+ /// A local host system implementation that will return the current time 
82+ /// with the system time zone as a fallback. 
83+ /// 
84+ /// This implementation is backed by [`std::time::SystemTime`] and [`iana_time_zone`] 
85+ #[ cfg( feature = "sys-local" ) ]  
86+ pub  struct  LocalHostSystem ; 
87+ 
88+ #[ cfg( feature = "sys-local" ) ]  
89+ impl  HostHooks  for  LocalHostSystem  { } 
90+ 
91+ #[ cfg( feature = "sys-local" ) ]  
92+ impl  HostClock  for  LocalHostSystem  { 
93+     fn  get_host_epoch_nanoseconds ( & self )  -> TemporalResult < EpochNanoseconds >  { 
94+         get_system_nanoseconds ( ) 
95+     } 
96+ } 
97+ 
98+ #[ cfg( feature = "sys-local" ) ]  
99+ impl  HostTimeZone  for  LocalHostSystem  { 
100+     fn  get_host_time_zone ( 
101+         & self , 
102+         provider :  & impl  timezone_provider:: provider:: TimeZoneProvider , 
103+     )  -> TemporalResult < TimeZone >  { 
104+         get_system_timezone ( provider) 
105+     } 
106+ } 
107+ 
108+ #[ cfg( feature = "sys-local" ) ]  
63109#[ inline]  
64110pub ( crate )  fn  get_system_timezone ( provider :  & impl  TimeZoneProvider )  -> TemporalResult < TimeZone >  { 
65111    iana_time_zone:: get_timezone ( ) 
0 commit comments