title: C: string to milisecs timestamp
body: <p>I want return in a function a time_t value from timestamp in string format but i don't get it. I need help.</p>
  
  <p>I read a string KEY of a Redis database that it is a timestamp value with form, for example, "1456242904.226683"</p>
  
  <p>My code is:</p>
  
  <pre><code>time_t get_ts(redisContext *ctx)
  {
      redisReply *reply;
      reply = redisCommand(ctx, "GET %s", "KEY");
      if(reply == NULL){
          return -1;
      }
  
      char error[255];
      sprintf(error, "%s", "get_ts 2:",reply-&gt;str);
      send_log(error);
  
      freeReplyObject(reply);
  
      return reply-&gt;str;
  }
  </code></pre>
  
  <p>reply->str is a string value but i need return a time_t value.</p>
  
  <p>How can i do it?</p>
  
  <p>Thanks</p>