How to convert string to date and then parse it to correct string output in Kotlin
I get date as string from backend and now at first I need to convert it to date time and then to compare this date and current date difference in years, months, weeks, days, minutes and seconds. In JS I can do this easily with moment JS like this
function extractTime(time) {
return {
seconds: moment().diff(time, 'seconds'),
minutes: moment().diff(time, 'minutes'),
hours: moment().diff(time, 'hours'),
days: moment().diff(time, 'days'),
weeks: moment().diff(time,...