public static long parseTimeStamp(String timestamp) {
        try {
            if (timestamp.contains("Z")) {
                timestamp = timestamp.replace("Z", "+00:00");
            }
            final Date date = SDF.parse(timestamp);
            return date != null ? date.getTime() : 0L;
        } catch (ParseException e) {
            return 0L;
        }
    }
Formats the timestamp

@param timestamp timestamp
mesh/src/main/java/no/nordicsemi/android/mesh/utils/MeshParserUtils.java