title: Sqlite: How to bind and insert date from C++?
body: <p>Using C++ (Visual Studio) and sqlite.  How do I bind a date to a parameter?</p>
  
  <pre><code>sqlite3_stmt *statement;
  
  const char *sql = 
      "INSERT INTO employees "
          "(full_name,"
          "date_started)" 
      " VALUES "
          "(@full_name,"
          "@date_started)";
  
  sqlite3_prepare_v2(database_, sql, -1, &amp;statement, NULL);
  
  int parameterIndex = sqlite3_bind_parameter_index(statement, "@full_name");
  sqlite3_bind_text(statement, parameterIndex, "John Smith", -1, SQLITE_TRANSIENT);
  
  parameterIndex = sqlite3_bind_parameter_index(statement, "@date_started");
  
  // &lt;??? what goes here ???&gt;
  // I want to include the local current time, so I want to know:
  // 1. what's the best way to get local time in C++
  // 2. and what goes here for the date binding
  
  sqlite3_step(statement);
  
  sqlite3_finalize(statement);
  </code></pre>
  
  <p>Note: I <em>don't</em> want to set the current time using sql (e.g, CURRENT_TIMESTAMP, etc.)</p>