using UnityEngine;
using UnityEngine.UI;
using System;
using System.Collections;
public class ClockDigital : MonoBehaviour {
private Text textClock;
// Use this for initialization
void Start () {
textClock = GetComponent<Text>();
}
// Update is called once per frame ( nom 60 FPS. )
void Update () {
textClock.text = DateTime.Now.ToString("HH:mm:ss");
}
// Load of Crap !!
//void Update (){
// DateTime time = DateTime.Now;
// string hour = LeadingZero( time.Hour );
// string minute = LeadingZero( time.Minute );
// string second = LeadingZero( time.Second );
// textClock.text = hour + ":" + minute + ":" + second;
//}
//string LeadingZero (int n){
// return n.ToString().PadLeft(2, '0');
//}
}