public static int parseTime(final String time) {
        int sum = 0;
        String buffer = "";

        for (int i = 0; i < time.length(); i++) {
            final char c = time.charAt(i);

            if (Character.isDigit(c)) {
                buffer += c;
            } else {
                int amount = Integer.parseInt(buffer);

                switch (String.valueOf(c)) {
                    case "s": sum += amount; break;
                    case "m": sum += 60 * amount; break;
                    case "h": sum += 60 * 60 * amount; break;
                    case "d": sum += 60 * 60 * 24 * amount; break;
                    case "w": sum += 60 * 60 * 24 * 7 * amount; break;
                    case "y": sum += 60 * 60 * 24 * 365 * amount; break;
                }

                buffer = "";
            }
        }

        if (sum == 0) {
            return 0;
        }

        return ((int) (System.currentTimeMillis() / 1000L)) + sum;
    }