Some useful code related to date in Magento :

1/ Get the current time :

 

2/Get the first day of current month:

 

3/Get the last day of current month :

 

4/Get the first day of previous month :

 

5/Get the last day of previous month :