You are here

function date_datetime2timestamp in Date 5.2

Same name and namespace in other branches
  1. 6.2 date_php4/date_php4.inc \date_datetime2timestamp()
  2. 6 date_php4/date_php4.inc \date_datetime2timestamp()

Create a timestamp from a datetime value.

Can't use date_convert() to turn datetime to unix within the PHP 4 emulation because it creates endless loops.

1 call to date_datetime2timestamp()
date_php4.inc in date_php4/date_php4.inc

File

date_php4/date_php4.inc, line 588

Code

function date_datetime2timestamp($datetime, $timezone) {
  preg_match(DATE_REGEX_LOOSE, $datetime, $regs);
  return date_mktime(isset($regs[5]) ? $regs[5] : 0, isset($regs[6]) ? $regs[6] : 0, isset($regs[7]) ? $regs[7] : 0, isset($regs[2]) ? $regs[2] : 0, isset($regs[3]) ? $regs[3] : 0, isset($regs[1]) ? $regs[1] : 0, $timezone);
}