package utils

import (
	"errors"
	"strconv"
	"strings"
)

func GetTimeStampFromMsg(msg string) (int64,error) {
	var err error
	list := strings.Split(msg,"Timestamp:")
	if len(list) != 2 {
		return 0,errors.New("Wrong msg type")
	}

	var timestamp int
	timestamp ,err = strconv.Atoi(list[1])
	if err != nil {
		return 0,err
	}
	return int64(timestamp),nil
}