参考微软的datetime文档
正常输出是中文的周几,需要中文的星期几可以通过英文转中文实现
实现效果如图所示:
代码如下:
public class TimeControl : MonoBehaviour
{
public TextMeshProUGUI TimeText01;
public TextMeshProUGUI TimeText02;
public TextMeshProUGUI TimeText03;
public DateTime NowSystemTime;
void Start()
{
NowSystemTime = DateTime.Now.ToLocalTime();
TimeText01.text = NowSystemTime.ToString("HH:mm");
TimeText02.text = NowSystemTime.ToString("dddd",new CultureInfo("zh-CN"));
TimeText03.text = NowSystemTime.ToString("yyyy MM dd");
}
}
}