I am using pymongo
I have a mongo db in which all documents have a "timestamp" : "25-OCT-2011"
So a string is stored in the key timestamp
in all documents.
I want to apply a python function as mentioned below on these string dates and convert them into a datetime object. What's the best way to do this in mongodb?
import datetime
def make_date(str_date):
return datetime.datetime.strptime(str_date, "%d-%b-%Y")