title: Store DateTime Value in AsyncStorage while the AppState Changes
body: <p>I am trying to store DateTime Value when the state of App changes.For suppose the app is in Background and I want to store the value of DateTime in AsyncStorage and when the app is in active state I want to calculate the time difference. But the promise which i get as a return value is null. My RN Version is 56.0 can anyone help me out?</p>
  
  <pre><code>StoreDate = async () =&gt; {
          await AsyncStorage.setItem('date', new Date());
        };
  
        retrieveDate = async () =&gt; 
        {
          try{
          let value = await AsyncStorage.getItem('date');
          console.log("value",value);
          Alert.alert(value);
          return JSON.parse(value);
  
      }
            catch(error){
              Alert.alert(error);
            }
        };
  
       if (this.state.appState.match(/inactive/) &amp;&amp; nextAppState === 'background') {
      let getDateTime = this.StoreDate().then((filter) =&gt; {
              console.log("filter",filter);
              console.log("getDateTime",getDateTime);
            });
      }
  </code></pre>
  
  <p>** Null promise returned when trying to retrieve the values using getItem **</p>
  
  <p><a href="https://i.stack.imgur.com/S8wXC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S8wXC.png" alt="enter image description here"></a></p>