How do I create a variable to check last time hook_cron() implemented from a custom module was ran?
You are implementing the wrong hook. What you are trying to implement is hook_variable_info(), used from the Variable module. Hook name apart, that hook implementation seems correct.

Instead of using variable_set(), you should use variable_set_value(). The equivalent of variable_get() is variable_get_value().

See the project page for more information about how to use the module API,  Variable API for a list of available functions, and variable.api.php for a list of hooks used from the Variable module.

The code you want to use should be similar to the following one.

function mymodule_cron() {
  if (variable_get_value('mymodule_last_run') &lt;= strtotime('-1 day')) {
    // Omissis.
    variable_set_value('mymodule_last_run', REQUEST_TIME);
  }
}

function mymodule_variable_info($options) {
  $variable['mymodule_last_run'] = array(
    'title' =&gt; t('Last Run', array(), $options),
    'type' =&gt; 'datetime',
    'default' =&gt; 0,
  );
}


Notice that variable_get_value() doesn't need the default value, since it gets it from the hook_variable_info() implementation done from your module. If you need to use a different default, you call the function as variable_get_value('mymodule_last_run', array('default' =&gt; REQUEST_TIME).

As for your original code, you don't call t() as t(time(), array(), $options) because:


The first argument of t() must be a literal string, not the value returned from a function
time() returns an integer; even if it would be casted to a string, t() doesn't change an integer in any way, for example returning '1,000' when receiving 1000 as first argument.


If the Variable module is expecting a string (e.g. '19700318T19:00') as default value for a variable of type datetime, you need to use a different function.