Added get function and fixed datetime type