Working to issue #1963. Successfully ported asDate() and asDatetime() methods to functions