How can I convert a string representing time in the format of <number>[m|h|d|s|w] (m= minutes, h=hours, d=days, s=seconds w=week) to number of seconds? E.g.: def convert_to_seconds(timeduration): ... convert_to_seconds("1h") -> 3600 convert_to_seconds("1d") -> 86400 Continue reading...