📅  最后修改于: 2022-03-11 14:49:02.661000             🧑  作者: Mango
using System;
//then inside your public class
public static DateTime theTime = DateTime.Now; //the time
[SerializeField] private string date = theTime.ToString("yyyy-MM-dd\\Z"); //convert time and date to string
[SerializeField] private string time = theTime.ToString("HH:mm:ss");
[SerializeField] private string dateTime = theTime.ToString("yyyy-MM-dd\\THH:mm:ss\\Z");