大马资讯论坛 - 马来西亚中文资讯平台

 找回密码
 注册
搜索
打印 上一主题 下一主题

Vb.net(Win) 时间 与 日期 Date Time 教学(图)

[复制链接]
跳转到指定楼层
1#
发表于 2010-2-3 07:24:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
DateTime myDtae = DateTime.Now;

this.listBox1.Items.Add("ToBinary: " + myDtae.ToBinary().ToString());
this.listBox1.Items.Add("ToFileTime: " + myDtae.ToFileTime().ToString());
this.listBox1.Items.Add("ToFileTimeUtc: " + myDtae.ToFileTimeUtc().ToString());
this.listBox1.Items.Add("ToLocalTime: " + myDtae.ToLocalTime().ToString());
this.listBox1.Items.Add("ToLongDateString: " + myDtae.ToLongDateString().ToString());
this.listBox1.Items.Add("ToLongTimeString: " + myDtae.ToLongTimeString().ToString());
this.listBox1.Items.Add("ToOADate: " + myDtae.ToOADate().ToString());
this.listBox1.Items.Add("ToShortDateString: " + myDtae.ToShortDateString().ToString());
this.listBox1.Items.Add("ToShortTimeString: " + myDtae.ToShortTimeString().ToString());
this.listBox1.Items.Add("ToString: " + myDtae.ToString().ToString());
this.listBox1.Items.Add("ToUniversalTime: " + myDtae.ToUniversalTime().ToString());
this.listBox1.Items.Add("Year: " + myDtae.Year.ToString());
this.listBox1.Items.Add("Month: " + myDtae.Month.ToString());
this.listBox1.Items.Add("Date: " + myDtae.Date.ToString());
this.listBox1.Items.Add("Day: " + myDtae.Day.ToString());
this.listBox1.Items.Add("Hour: " + myDtae.Hour.ToString());
this.listBox1.Items.Add("Minute: " + myDtae.Minute.ToString());
this.listBox1.Items.Add("Millisecond: " + myDtae.Millisecond.ToString());
this.listBox1.Items.Add("DayOfWeek: " + myDtae.DayOfWeek.ToString());
this.listBox1.Items.Add("DayOfYear: " + myDtae.DayOfYear.ToString());
this.listBox1.Items.Add("TimeOfDay: " + myDtae.TimeOfDay.ToString());
this.listBox1.Items.Add("Kind: " + myDtae.Kind.ToString());
this.listBox1.Items.Add("Ticks: " + myDtae.Ticks.ToString());
this.listBox1.Items.Add("===============================================");
this.listBox1.Items.Add("AddDays(5): " + myDtae.AddDays(5).ToString());
this.listBox1.Items.Add("AddHours(5): " + myDtae.AddHours(5).ToString());
this.listBox1.Items.Add("AddMilliseconds(5): " + myDtae.AddMilliseconds(5).ToString());
this.listBox1.Items.Add("AddMinutes(5): " + myDtae.AddMinutes(5).ToString());
this.listBox1.Items.Add("AddMonths(5): " + myDtae.AddMonths(5).ToString());
this.listBox1.Items.Add("AddSeconds(5): " + myDtae.AddSeconds(5).ToString());
this.listBox1.Items.Add("AddTicks(5): " + myDtae.AddTicks(5).ToString());
this.listBox1.Items.Add("AddYears(5): " + myDtae.AddYears(5).ToString());
this.listBox1.Items.Add("GetDateTimeFormats: " + myDtae.GetDateTimeFormats());
this.listBox1.Items.Add("GetType: " + myDtae.GetType().ToString());
this.listBox1.Items.Add("GetTypeCode: " + myDtae.GetTypeCode().ToString());
this.listBox1.Items.Add("IsDaylightSavingTime: " + myDtae.IsDaylightSavingTime().ToString());
this.listBox1.Items.Add("Subtract: " + myDtae.Subtract(DateTime.Now).ToString());
String s = myDtae.ToLocalTime().ToString();
this.listBox1.Items.Add("Parse: " + DateTime.Parse(s));

手机版|大马资讯论坛  

GMT+8, 2024-11-1 08:10 , Processed in 0.033843 second(s), 12 queries , File On.

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表