I’m thinking of strings like “one minute ago” or “3 weeks ago”, that kind of thing.
I could easily port examples I’ve found in other languages but there’s no need to reinvent the wheel if this stuff is already out there.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Something you can try is date.js: http://www.datejs.com/
To make it node compatible at the very bottom of the script add the line:
module.exports = Date;Then you can require it:
var date = require('./date');Assuming date.js is in the same folder, otherwise modify the require path.
Then a simple code sample to test is:
console.log( date.today().next().thursday() )