You are here

function _scheduler_strtotime in Scheduler 5

Same name and namespace in other branches
  1. 6 scheduler.module \_scheduler_strtotime()
  2. 7 scheduler.module \_scheduler_strtotime()

Converts an english time string ('Y-m-d H:i:s') from the users timezone into an unix timestamp

Parameters

string $str the time string ('Y-m-d H:i:s'):

Return value

the time in unix timestamp representation (utc); NULL, if $str is NULL, FALSE, empty, or contains only white spaces; FALSE, if $str is malformed

2 calls to _scheduler_strtotime()
scheduler_nodeapi in ./scheduler.module
Implementation of hook_nodeapi().
_scheduler_form_validate in ./scheduler.module
Implementation of hook_form_validate() Validate the input of the publish and unpublish date fields

File

./scheduler.module, line 220

Code

function _scheduler_strtotime($str) {
  if ($str && trim($str) != "") {
    $time = _scheduler_strptime(trim($str), variable_get('scheduler_date_format', SCHEDULER_DATE_FORMAT));
    if ($time !== FALSE) {

      // success
      $time -= _scheduler_get_user_timezone();
    }
  }
  else {

    // $str is empty
    $time = NULL;
  }
  return $time;
}