Commit 597e69c5 authored by Steve Müller's avatar Steve Müller

add date arithmetic expressions in DB2

parent 9f1bb321
......@@ -127,6 +127,62 @@ class DB2Platform extends AbstractPlatform
return $autoinc;
}
/**
* {@inheritdoc}
*/
public function getDateAddDaysExpression($date, $days)
{
return $date . ' + ' . $days . ' days';
}
/**
* {@inheritdoc}
*/
public function getDateAddHourExpression($date, $hours)
{
return $date . ' + ' . $hours . ' hours';
}
/**
* {@inheritdoc}
*/
public function getDateAddMonthExpression($date, $months)
{
return $date . ' + ' . $months . ' months';
}
/**
* {@inheritdoc}
*/
public function getDateDiffExpression($date1, $date2)
{
return 'DAYS(' . $date1 . ') - DAYS(' . $date2 . ')';
}
/**
* {@inheritdoc}
*/
public function getDateSubDaysExpression($date, $days)
{
return $date . ' - ' . $days . ' days';
}
/**
* {@inheritdoc}
*/
public function getDateSubHourExpression($date, $hours)
{
return $date . ' - ' . $hours . ' hours';
}
/**
* {@inheritdoc}
*/
public function getDateSubMonthExpression($date, $months)
{
return $date . ' - ' . $months . ' months';
}
/**
* {@inheritDoc}
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment