using System.Collections; using System.Collections.Generic; using UnityEngine; using System; using UnityEngine.UI; public class TimeNow : MonoBehaviour { // Start is called before the first frame updat // Update is called once per frame void Update() { DateTime datetime = DateTime.Now; string str = string.Format("{0:D2}:{1:D2}:{2:D2}",datetime.Hour,datetime.Minute,datetime.Second); GetComponent().text = str; } }