date/time calculations

Database
N/A

date/time calculations

How to calculate beginning of the day,end of the day,beginning of month,end of month. I want this along with time upto 3 places.

thanks