Storing/querying custom date data

I would store as a custom field, like you say as a timestamp or ISO 8601 (YYYY-MM-DD). That way you can leverage WP_Query’s Custom Field Parameters for queries within your theme files.

For instance:

// Get posts where the custom field is less than the current time

$foo = new WP_Query(array(
  // other query vars...
  'meta_query' => array(
    array(
      'key' => 'date_custom_field',
      'value' => time(),
      'compare' => '<'
    )
  )
));

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)