需要显示日期,格式为 dd.mm.yy 比如 "06.07.10" 即七月六日。
俺不加思考地写道:
Date today = getDate();
int month = today.GetMonth;
int day = today.GetDay;
string_month="";
string_day ="";
if month <=9 string_month = "0" + month
else string_month = month
if day <=9 string_day = ")" + day
else string_day = day
final_date = string_day + "." + string_month + "." + "10"
同事走过来, 看看code, 又看看我, 再看看code, 再看看我。抢过键盘, 愤怒地敲出下面一行:
final_date = getDate().ToString().Format("dd.mm.yy");
俺一看, 大叫一声,掩面倒地,不省人事,吐血而亡。
俺不加思考地写道:
Date today = getDate();
int month = today.GetMonth;
int day = today.GetDay;
string_month="";
string_day ="";
if month <=9 string_month = "0" + month
else string_month = month
if day <=9 string_day = ")" + day
else string_day = day
final_date = string_day + "." + string_month + "." + "10"
同事走过来, 看看code, 又看看我, 再看看code, 再看看我。抢过键盘, 愤怒地敲出下面一行:
final_date = getDate().ToString().Format("dd.mm.yy");
俺一看, 大叫一声,掩面倒地,不省人事,吐血而亡。