changed API to accept current datetime