Machine learning or NLP approach to convert string about month ,year into dates I'm currently in the process of developing a program with the capability of converting human style of representing year into actual dates.
Example : last year last month into December 2018
string may be complete sentence like : what were you doing 5 years ago 

it will gives 2014

The purpose is to evalute human style of represting year or date into actual date, i have created collection of this type of strings and matching them with regex.

I have read some machine learning but I'm not sure which algorithm suits this problem the best or if I should consider using NLP.

Does anyone have a suggestion of what algorithm to use or where I can find the necessary literature to solve my problem?

Thanks for any contribution!
I got my answer , NLTK is good to go for this problem. 
You may use sutime with python wrapper : 

Python wrapper for Stanford CoreNLP's SUTime 

The usual approach in NLP is to collect a dataset required for training. Process that dataset so that the words in the dataset are converted into numbers.

One simple example of converting it into numbers is to make a large dictionary of words from the dataset and use the index of each word in the dictionary as the representing number