DateTime dt = DateTimeNow;
LabelText = dtToString();// ::
LabelText = dtToFileTime()ToString();//
LabelText = dtToFileTimeUtc()ToString();//
LabelText = dtToLocalTime()ToString();// ::
LabelText = dtToLongDateString()ToString();//年月*
LabelText = dtToLongTimeString()ToString();//::
LabelText = dtToOADate()ToString();//
LabelText = dtToShortDateString()ToString();//
LabelText = dtToShortTimeString()ToString();//:
LabelText = dtToUniversalTime()ToString();// ::
? ::
LabelText = dtYearToString();//
LabelText = dtDateToString();// ::
LabelText = dtDayOfWeekToString();//Saturday
LabelText = dtDayOfYearToString();//
LabelText = dtHourToString();//
LabelText = dtMillisecondToString();//
LabelText = dtMinuteToString();//
LabelText = dtMonthToString();//
LabelText = dtSecondToString();//
LabelText = dtTicksToString();//
LabelText = dtTimeOfDayToString();//::
LabelText = dtToString();// ::
LabelText = dtAddYears()ToString();// ::
LabelText = dtAddDays()ToString();// ::
LabelText = dtAddHours()ToString();// ::
LabelText = dtAddMilliseconds()ToString();// ::
LabelText = dtAddMonths()ToString();// ::
LabelText = dtAddSeconds()ToString();// ::
LabelText = dtAddMinutes()ToString();// ::
LabelText = dtAddTicks()ToString();// ::
LabelText = dtCompareTo(dt)ToString();//
//LabelText = dtAdd(?)ToString();//問號為一個時間段
LabelText = dtEquals( ::)ToString();//False
LabelText = dtEquals(dt)ToString();//True
LabelText = dtGetHashCode()ToString();//
LabelText = dtGetType()ToString();//SystemDateTime
LabelText = dtGetTypeCode()ToString();//DateTime
LabelText = dtGetDateTimeFormats(s)[]ToString();//T::
LabelText = dtGetDateTimeFormats(t)[]ToString();//:
LabelText = dtGetDateTimeFormats(y)[]ToString();//年月
LabelText = dtGetDateTimeFormats(D)[]ToString();//年月*
LabelText = dtGetDateTimeFormats(D)[]ToString();//
LabelText = dtGetDateTimeFormats(D)[]ToString();//星期六
LabelText = dtGetDateTimeFormats(D)[]ToString();//星期六 年月*
LabelText = dtGetDateTimeFormats(M)[]ToString();//月*
LabelText = dtGetDateTimeFormats(f)[]ToString();//年月* :
LabelText = dtGetDateTimeFormats(g)[]ToString();// :
LabelText = dtGetDateTimeFormats(r)[]ToString();//Sat Nov :: GMT
或者dtToString(yyyy年MM月dd*);//年月*
dtToString(yyyyMMdd);//*
以此類推……
LabelText =? stringFormat({:d}dt);//
LabelText =? stringFormat({:D}dt);//年月*
LabelText =? stringFormat({:f}dt);//年月* :
LabelText =? stringFormat({:F}dt);//年月* ::
LabelText =? stringFormat({:g}dt);// :
LabelText =? stringFormat({:G}dt);// ::
LabelText =? stringFormat({:M}dt);//月*
LabelText =? stringFormat({:R}dt);//Sat Nov :: GMT
LabelText =? stringFormat({:s}dt);//T::
LabelText = stringFormat({:t}dt);//:
LabelText = stringFormat({:T}dt);//::
LabelText = stringFormat({:u}dt);// ::Z
LabelText = stringFormat({:U}dt);//年月* ::
LabelText = stringFormat({:Y}dt);//年月
LabelText = stringFormat({}dt);// ::?
LabelText = stringFormat({:yyyyMMddHHmmssffff}dt); //yyyymm等可以設置比如LabelText = stringFormat({:yyyyMMdd}dt);
綁定也適用:例:<%# stringFormat({:yyyyMMdd}eval_r(sj))%>
From:http://tw.wingwit.com/Article/program/net/201311/12583.html