Revert "delete function in rules.inc file"

This reverts commit 8f87bc403804b17df6881ecc8096bc490cc94ba9.
changed date field to type datetime