iLMS知識社群歷程檔登入
位置: 黃國哲 > Unity
1111225 時鐘
by 黃國哲 2022-12-25 13:32:43, 回應(1), 人氣(1000)
https://cindyalex.pixnet.net/blog/post/240454079-unity-c%23-%e7%b3%bb%e7%b5%b1%e6%99%82%e9%96%93datetime


https://blog.csdn.net/ChinarCSDN/article/details/82934928
 

其他時間單位
http://www.aspphp.online/bianchen/cyuyan/gycyy/201701/196832.html

毫秒
https://blog.csdn.net/weixin_44328367/article/details/106715024

DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000


當前時間的毫秒
https://blog.csdn.net/cumt30111/article/details/107766298?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-107766298-blog-73828639.pc_relevant_default&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-107766298-blog-73828639.pc_relevant_default&utm_relevant_index=1


////////////////////////////////////////////////////////////////////
using UnityEngine.UI;    //使用UnityEngine.UI
using System;    //使用System

public Text DateTimeText;    //宣告UI文字物件


void Update () {

        DateTimeText.text = DateTime.Now.ToString ();  //讓UI文字物件顯示現在的系統時間

}

///////////////////////////////////////////////////////////

public long now

void Update () {

        DateTimeText.text = TimerState.now.ToString ();  //讓UI文字物件顯示現在的系統時間;

///////////////////////////////////////////////////////////

DateTime dt = DateTime.Now;

int ms = dt.Millisecond; //DateTime.Millisecond


string nowt = DateTime.Now.ToString (); 
string nowms = DateTime.Millisecond.ToString (); 

DateTimeText.text = (nowt + nowms); 

/////////////////////////////////

DateTime.Now:顯示現在時間的所有資訊 (e.g. 9/20/2018 11:30:00 PM)

DateTime.Now.XXX:顯示現在時間的個別資訊相關的係數如下 (e.g. DateTime.Now.Day)

Year:顯示西元年。

Month:顯示月份。

Day:顯示日期。

Hour:顯示小時。

Minute:顯示分鐘。

Second:顯示秒數。

回應(1)
Our companions are prepared to make social occasions more comfortable and engaging. South Delhi Escorts bring warmth, confidence, and interesting conversation to every meeting. They enjoy discovering new settings with clients, while our service emphasizes thoughtful and respectful companionship.

回應