社区
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后 会有年月日上去 我不要 需要去掉
...全文
777
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")
C#
dateTime
Picker只显示
时分秒
控件属性设置如下: CustomFormat 设为 HH:mm:ss ShowUpDown 设为 True
C#
DateTime
去掉
时分秒
几种方法
//去掉
时分秒
,返回
DateTime
Console.WriteLine(now.ToShortDateString()); //去掉
时分秒
,返回string Console.WriteLine(now.ToString(“d”)); //去掉
时分秒
,返回string Console.WriteLine(now.ToString(“yyyy-...
C#
DateTime
类取各种时间格式
DateTime
数字型 [c-sharp] view plaincopy System.
DateTime
currentTime=new System.
DateTime
();...1.1 取当前年月日
时分秒
[c-sharp] view plaincopy currentTime=System.
DateTime
.Now;
C#
获取当前系统时间
--
DateTime
数字型 System.
DateTime
currentTime=new ...取当前年月日
时分秒
currentTime=System.
DateTime
.Now; 取当前年 int 年=currentTime.Year; 取当前月 int 月=currentTime.Month; 取当前日 int 日=curr...
C#
中
DateTime
时间只比较到秒级
针对业务场景:由于
DateTime
的精度到了微秒之后,只需要比较到秒的业务场景 示例代码如下:
DateTime
dt1 =
DateTime
.Parse(
DateTime
.now().ToString("yyyy-MM-dd HH:mm:ss"));
DateTime
dt2 = ...
ASP
28,390
社区成员
357,060
社区内容
发帖
与我相关
我的任务
ASP
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
复制链接
扫一扫
分享
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章