I'm having the same problem from this previous question.
I keep getting some nulls after running expression. Not sure why it works on some dates
I have dates(strings) in the form 1/4/2005, 11/11/2004, etc
Here is code I used in field calculator:
btw data will be uploaded to django app using PostGeSQL
from qgis.core import *
from qgis.gui import *
from PyQt4.QtCore import QDate
@qgsfunction(args="auto", group='Python')
def parse_date_dmy(fromval, feature, parent):
return QDate.fromString(fromval, 'dd/MM/yyyy')