title: Getting the current date (and time) in Django
body: <p>I was wondering what is the best way to get the current date in a django application.</p>
  
  <p>Currently I query the python datetime module - but since I need the date all over the place I thought maybe Django already has a buildin function for that.</p>
  
  <p>e.g. I want to filter objects created in the current year so I would do the following:</p>
  
  <pre><code>YEAR = datetime.date.now().year
  currentData = Data.objects.filter(date__year=YEAR)
  </code></pre>
  
  <p>Should I define the <code>YEAR</code> variable in <code>settings.py</code> or create a function now() or is there a buildin Function for this?</p>