asp.net 处理和计算微博发布时间
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace MicroBlogForWP7.Classes
{
public class TimeParser
{
/// <summary>
/// 把秒转换成分钟
/// </summary>
/// <returns></returns>
public static int SecondToMinute(int Second)
{
decimal mm = (decimal)((decimal)Second / (decimal)60);
return Convert.ToInt32(Math.Ceiling(double.Parse(mm.ToString())));
}
#region 返回某年某月最后一天
/// <summary>
/// 返回某年某月最后一天
/// </summary>
/// <param name="year">年份</param>
/// <param name="month">月份</param>
/// <returns>日</returns>
public static int GetMonthLastDate(int year, int month)
{
DateTime lastDay = new DateTime(year, month, new System.Globalization.GregorianCalendar().GetDaysInMonth(year, month));
int Day = lastDay.Day;
return Day;
}
#endregion
#region 返回时间差
public static string DateDiff(DateTime DateTime1, DateTime DateTime2)
{
string dateDiff = null;
try
相关新闻>>
- 发表评论
-
- 最新评论 进入详细评论页>>
今日头条
更多>>您可能感兴趣的文章
- .NET简谈互操作(四:基础知识之Dispose非托管内存
- .net架构的最后思考(箴言)
- 使用ASP.NET MVC3+EF+Jquery制作文字直播系统(四
- asp.net DataTable和Dataset序列化成Json格式
- JQuery+Asp.net MVC实现用户名重名查询
- Spring MVC 3.0.5+Spring 3.0.5+MyBatis3.0.4全注
- Web Service学习笔记(4)
- .NET设计模式:工厂方法模式(Factory Method)[1]
- 聊聊.net程序设计——浅谈使用VS2010建模拓展(下
- MVC3+Entity Framework 实现投票系统(二)



