updated to use datetime rather than just ms