title: How to write queries for DATE TIME data type in SQLITE iphone
body: <ul>
  <li>In my sqlite data base I have a field for <strong>time</strong>.</li>
  <li>till now i used time with type '<strong>varChar</strong>'. it is working perfectly</li>
  <li>But now i need to change the type in to <strong>DateTime.</strong></li>
  <li><p>how can i change the followin queries to convert from varchar to date &amp; time type.
  -in my tabele columns are 'time'(DATETIME), 'Comments'(VARCHAR)</p>
  
  <ul>
  <li>in select all method.
  <hr></li>
  </ul>
  
  <p>(NSMutableArray *)selectAllFromDB
  {                </p>
  
  <p><strong>time=[NSString stringWithUTF8String:(char *)sqlite3_column_text(selectAllStmt, 0)];</strong></p></li>
  </ul>
  
  <p>}
      <strong><em>_</em>_</strong></p>
  
  <pre><code>-in insert method
  
  -(BOOL)insertIntoDB:(NSMutableDictionary *)dict
  {
          time=[dict objectForKey:@"time"];
  
          if(sqlite3_bind_text(insertStmt, 1, [time UTF8String], -1, SQLITE_TRANSIENT) != SQLITE_OK) 
          {
              return NO;
          }
  
  }
  </code></pre>
  
  <p>how to modify these queries for <strong>date</strong> data type</p>