title: insert current time into mongo using pymongo
body: <p>I'm trying to store a current time in specific format, when new document where created.
  Here is the part of the code that call's not working method:</p>
  
  <pre><code>    dbm = AccountsDB()
      dbm.store_info(user_info)
  </code></pre>
  
  <p>And here is the actual AccountsDB() class:</p>
  
  <pre><code>#! /usr/bin/env python2.7
  
  import pymongo
  import datetime
  import time
  
  class AccountsDB():
      def store_info(self, user_info=None):
          try:
              conn = pymongo.Connection('localhost', 27017)
              db_name = 'accountsdb'
              coll_name = 'user_info'
  
              db = conn[db_name]
              coll = db[coll_name]
              print "Successfully connected to '%s'" % db_name
  
              now = datetime.datetime.now()
              if user_info is not None:
                  now = datetime.datetime.now()
                  ''' 
                  This is not Working...
  
                  created_time = {
                      'created_time': {
                          'day': now.day,
                          'month': now.month,
                          'year': now.year,
                          'hour': now.hour,
                          'minute': now.minute,
                          'second': now.second,
                          'microsecond': now.microsecond
                      }
                  }
                  user_info.append(created_time)
                  '''
                  print user_info
                  coll.insert(user_info)
              else:
                  print 'No user_info'
              print "Data where stored in database"
          except:
              print "Some Error Occured"
  </code></pre>
  
  <p>I want  document looks something like this:</p>
  
  <pre><code>&gt; db.user_info.find().pretty()
  {
      "_id" : ObjectId("50d8ded1bdbff3401c252f1a"),
      "ip" : "24.xx.xx.xx",
      "region_code" : "MA",
      "region_name" : "Massachusetts",
      "secret_answer2" : "Mercedes",
      "l_name" : "Flores",
      "f_name" : "Jacob",
      "country_name" : "United States",
          // I want to add next objects to the document
          'created_time': {
              'day': 10,
              'month': 11,
              'year': 12,
              'hour': 11,
              'minute': 11,
              'second': 22,
              'microsecond': 1234
      }
  }
  </code></pre>