Add ability to create datetime type in function