function _datereminder_now in Date Reminder 7
Same name and namespace in other branches
- 6.2 includes/date.inc \_datereminder_now()
- 6 includes/date.inc \_datereminder_now()
Get "now" in UTC as a string, with option offset from "now".
Parameters
int $offset: Optional offset from "now" in seconds
Return value
DateTime Time $offset seconds in tne future as DateTime.
4 calls to _datereminder_now()
- datereminder_tokens in ./
datereminder.module - Implements hook_tokens().
- _datereminder_cron in includes/
cron.inc - Implements hook_cron().
- _datereminder_get_next_occurance in includes/
date.inc - Return string datetime for next occurance after a suitable delay from now.
- _datereminder_get_next_reminder in includes/
date.inc - Compute time of next reminder.
File
- includes/
date.inc, line 80 - Some functions dealing with dates.
Code
function _datereminder_now($offset = 0) {
$utz = new DateTimeZone('UTC');
$now = new DateTime(NULL, $utz);
if ($offset != 0) {
$now
->modify("+{$offset} seconds");
}
return $now;
}