# Density of variables with defined borders

I'm trying to understand what is the right way to create density functions for time variables (e.g., hour).

When I'm building a density function for hour, I'm getting values which exceeds 0 and 24 (which has no meaning in my case, where I want to check the probabilty that new data point where "taken" from my distribution.

Is there a good approach to handle this problem?

I"ll be happy to hear of implementations of your answer in r