You are here

public function BirthdaysBirthday::toUnixtime in Birthdays 7

Coverts the value to a unix timestamp, 0:00:00 at the given date. Note that this depends on the timezone.

Return value

A unix timestamp where the year 2000 means no year, but could very well mean 2000 itself. So be careful or only use it to format dates with day and month. Or NULL.

1 call to BirthdaysBirthday::toUnixtime()
BirthdaysBirthday::toString in ./birthdays_birthday.inc
Converts the value to a string.

File

./birthdays_birthday.inc, line 203
The BirthdaysBirthday class.

Class

BirthdaysBirthday
Converts between different data representations and do calculations on a birthday.

Code

public function toUnixtime() {
  if ($this
    ->isEmpty()) {
    return NULL;
  }
  return mktime(0, 0, 0, $this->value['month'], $this->value['day'], $this->value['year'] ? $this->value['year'] : 2000);
}