Example #1
0
 /**
  * Imports the value and returns a unix timestamp (the number of seconds
  * since the epoch.)
  * @author Jeff Ober
  * @param string $value
  * @return int the date/time as a unix timestamp
  **/
 public function import_value($value)
 {
     $value = parent::import_value($value);
     if (strlen(trim($value)) > 0) {
         $simpleDate = \Pjango\Util\SimpleDate::parse($value, pjango_ini_get('DATETIME_FORMAT'));
         return $simpleDate->toString();
     }
     return null;
 }
Example #2
0
 /**
  * Imports the value and returns a unix timestamp (the number of seconds
  * since the epoch.)
  * @author Jeff Ober
  * @param string $value
  * @return int the date/time as a unix timestamp
  **/
 public function import_value($value)
 {
     $value = parent::import_value($value);
     return strtotime($value);
 }
Example #3
0
 /**
  * Imports the value and returns a unix timestamp (the number of seconds
  * since the epoch.)
  * @author Jeff Ober
  * @param string $value
  * @return int the date/time as a unix timestamp
  **/
 public function import_value($value)
 {
     $value = parent::import_value($value);
     if (preg_match($GLOBALS['phorms_tr']['dateformat_validation'], $value)) {
         $value = preg_replace($GLOBALS['phorms_tr']['dateformat_validation'], $GLOBALS['phorms_tr']['dateformat_replace'], $value);
     }
     return strtotime($value);
 }