社区
ASP
帖子详情
c# DateTime 只保留时分秒
liymzd
2010-07-15 02:53:57
有一个datetime的问题 要求
string strTime=9:10:10;
要求
datetime date = convert.todatetime(strTIme);
上面做某些操作后
messagebox(date.tostring())
为"9:10:10"
我现在messagebox后 会有年月日上去 我不要 需要去掉
...全文
809
5
打赏
收藏
c# DateTime 只保留时分秒
有一个datetime的问题 要求 string strTime=9:10:10; 要求 datetime date = convert.todatetime(strTIme); 上面做某些操作后 messagebox(date.tostring()) 为"9:10:10" 我现在messagebox后 会有年月日上去 我不要 需要去掉
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
liymzd
2010-07-15
打赏
举报
回复
做完某些操作后
再执行 最后这句话messagebox(date.tostring())会弹出9:10:10 楼上的都不行 我不等了 结贴吧
sy_binbin
2010-07-15
打赏
举报
回复
string ss = DateTime.Now.ToString("H:mm:ss");
Response.Write(ss);
sy_binbin
2010-07-15
打赏
举报
回复
string ss = DateTime.Now.ToString("hh:mm:ss");
Response.Write(ss);
孟子E章
2010-07-15
打赏
举报
回复
date.tostring("H:m:s")
日期处理大全
1、 初始化
DateTime
dt =
DateTime
.Now;//1
DateTime
dt = new
DateTime
();//2
DateTime
dt = default(
DateTime
);//3 1,2,3都行 Date? dt=null;不行 2 去掉日期中的
时分秒
DateTime
.ToShortDateString 3、将指定的天
C#
DateTime
去掉
时分秒
几种方法
DateTime
now =
DateTime
.Parse(“2015/01/23 13:50:00”); Console.WriteLine(now.Date); //去掉
时分秒
,返回
DateTime
Console.WriteLine(now.ToShortDateString()); //去掉
时分秒
,返回string Console.WriteLine(now.ToString(“d”));...
[摘录]解决
C#
DateTime
去掉
时分秒
几种方法
在
C#
中我们使用
DateTime
函数会带上当时的 年月日与
时分秒
了,函数考虑比较全面了但是有一点就是我们有时并不需要
时分秒
了,下面一起来看
DateTime
去掉
时分秒
几种方法 程序代码
DateTime
now =
DateTime
.Parse("2015/01/23 13:50:00"); Console.WriteLine(now.Date); //去掉
时分秒
,返回
DateTime
C...
ASP
28,403
社区成员
356,942
社区内容
发帖
与我相关
我的任务
ASP
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
复制链接
扫一扫
分享
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章