1. 程式人生 > >整形轉換為時間格式

整形轉換為時間格式

使用 TimeSpan 類進行

  void OnChangetheText(int currenttime)     {         timetext.text = currenttime.ToString();         TimeSpan span = new TimeSpan(0,0,currenttime);         timetext.text = (int)span.TotalHours + ":" + (int)span.TotalMinutes + ":" + (int)span.Seconds + "";         //Debug.Log(currenttime);     }