@@ 528-534 (lines=7) @@ | ||
525 | * @throws EE_Error |
|
526 | * @throws Exception |
|
527 | */ |
|
528 | public static function date_time_add(EE_Base_Class $obj, $datetime_field_name, $period = 'years', $value = 1) |
|
529 | { |
|
530 | //get the raw UTC date. |
|
531 | $DateTime = $obj->get_DateTime_object($datetime_field_name); |
|
532 | $DateTime = EEH_DTT_Helper::calc_date($DateTime, $period, $value); |
|
533 | return EEH_DTT_Helper::_set_date_time_field($obj, $DateTime, $datetime_field_name); |
|
534 | } |
|
535 | ||
536 | ||
537 | /** |
|
@@ 549-555 (lines=7) @@ | ||
546 | * @throws EE_Error |
|
547 | * @throws Exception |
|
548 | */ |
|
549 | public static function date_time_subtract(EE_Base_Class $obj, $datetime_field_name, $period = 'years', $value = 1) |
|
550 | { |
|
551 | //get the raw UTC date |
|
552 | $DateTime = $obj->get_DateTime_object($datetime_field_name); |
|
553 | $DateTime = EEH_DTT_Helper::calc_date($DateTime, $period, $value, '-'); |
|
554 | return EEH_DTT_Helper::_set_date_time_field($obj, $DateTime, $datetime_field_name); |
|
555 | } |
|
556 | ||
557 | ||
558 | /** |