All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ASP.NET网页发送和返馈运行机制_[Asp.Net教程]
注意那些容易被忽略的SQL注入技巧_[SQL Server教程]_0
Asp.net,Ajax,学习笔记2,UpdatePanel的使用(上)_[Asp.Net教程]
Linux操作系统中用PHP构建网站详解_php资料_编程技术
C#,WinForm中DataGrid列设置
用COM自动服务扩展SQL,Server的功能_[SQL,Server教程]
在虚拟主机上用asp.net轻松实现urlrewrite_[Asp.Net教程]
asp.net2.0内置Request对象的属性
SQL循序渐进(2)-------表的基础知识_[SQL,Server教程]
使用ASP.NET,2.0,DetailsView控件处理数据_[Asp.Net教程]
Reading number is top 10 pictures
So beauty, will let you spray blood4
美女当网吧管理员的悲剧
Tie a large font of mouse
2012 national geographic daily picture5
Chinese paper-cut grilles art appreciation5
Sora aoi in China1
餐桌上的鱼
ashlynn brooke
含苞欲放的素颜美少女1
Average female college students1
Download software ranking
Kung.Fu.Panda.2
linux初级教程
The Bermuda triangle2
Tram sex maniac 2 (H) rar bag2
The Bermuda triangle1
Boxer's Top ten classic battle8
功夫熊猫2(上集)
实战黑客不求人
美女写真3
Boxer's Top ten classic battle3
delv published in(发表于) 2014/1/24 9:03:06 Edit(编辑)
Asp.net,时间操作基类(短日期,长日期,时间差)_[Asp.Net教程]

Asp.net,时间操作基类(短日期,长日期,时间差)_[Asp.Net教程]

Asp.net 时间操作基类(短日期,长日期,时间差)_[Asp.Net教程]

/############################################
版权声明:
文章内容为本站编辑,创作.你可以任意转载、发布、使用但请务必以明文标注文章原始出处及本声明
http://www.opent.cn 作者:浪淘沙
############################################/

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace EC
{
///


/// 时间操作函数
///

public class TimeObject
{
///
/// 时间差
///

/// 开始时间
/// 结束时间
///
public static string GetTimeSpan(DateTime starttime, DateTime endtime)
{
TimeSpan ts = endtime - starttime;
return string.Format("{0}时{1}分{2}秒{3}毫秒", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds);
}

///
/// 转称为月-日:09-12
///

/// 日期
///
public static string ToDateMonthDay(DateTime d)
{
return d.ToString("MM-dd");
}
///
/// 转换为年月日:2006-09-12
///

///
///
public static string ToDateString(DateTime d)
{
return d.ToString("yyyy-MM-dd");
}
///
/// 转换为:小时:分:秒 00:29:58
///

///
///
public static string ToTimeString(DateTime t)
{
return t.ToString("HH:mm:ss");
}
///
/// 转换为长时间:2006-09-12 00:30:57
///

///
///
public static string ToDateTimeString(DateTime dt)
{
return dt.ToString("yyyy-MM-dd HH:mm:ss");
}


}

}

Asp.net 时间操作基类(短日期,长日期,时间差)


Asp.Net教程:/HtmlData/Program/Asp.Net/







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.