Sunday, September 28, 2014

Unity Ongui how to get total seconds per day

var timestring: String;


timestring = System.DateTime.Now.ToString("hh:mm:ss");
    
    //here we want to get seconds per day so we add up hourx3600 + minutesx60 + seconds


    total_second_per_day = (int.Parse(timestring.Substring(0,2))*3600) + (int.Parse(timestring.Substring(3,2)) *60)
    +int.Parse(timestring.Substring(6,2));




No comments:

Post a Comment