9 个解决方案
#1
System.DateTime.Compare 方法
#2
up
#3
谢谢.
DateTime dat1 = DateTime.Parse(2003-12-30);
DateTime dat2 = DateTime.Parse(2004-12-30);
if (dat1.CompareTo(dat2) > 0)
{
// dat1 > dat2;
}
else
{
// dat1 < dat2;
}
DateTime dat1 = DateTime.Parse(2003-12-30);
DateTime dat2 = DateTime.Parse(2004-12-30);
if (dat1.CompareTo(dat2) > 0)
{
// dat1 > dat2;
}
else
{
// dat1 < dat2;
}
#4
看看下面的代码:
if (DateTime.Compare(today,myHttpWebResponse.LastModified) == 0)
Console.WriteLine("\nThe requested URI entity was modified today");
else
if (DateTime.Compare(today,myHttpWebResponse.LastModified) == 1)
Console.WriteLine("\nThe requested URI was last modified on:{0}",
myHttpWebResponse.LastModified);
if (DateTime.Compare(today,myHttpWebResponse.LastModified) == 0)
Console.WriteLine("\nThe requested URI entity was modified today");
else
if (DateTime.Compare(today,myHttpWebResponse.LastModified) == 1)
Console.WriteLine("\nThe requested URI was last modified on:{0}",
myHttpWebResponse.LastModified);
#5
如果要知道两个日期的差值,又该如何?
#6
datediff也行啊。 :)
#7
DateTime dat1 = DateTime.Parse(2003-12-30);
DateTime dat2 = DateTime.Parse(2004-12-30);
if (DateTime.Compare(dat1 ,dat2 ) > 0)
{
// dat1 > dat2;
}
这样的写法比较正统,呵呵。
datediff的用法是怎么用的,请(易江流之梵炎) 指教。
DateTime dat2 = DateTime.Parse(2004-12-30);
if (DateTime.Compare(dat1 ,dat2 ) > 0)
{
// dat1 > dat2;
}
这样的写法比较正统,呵呵。
datediff的用法是怎么用的,请(易江流之梵炎) 指教。
#8
DateTime dat1 = DateTime.Parse(2003-12-30);
DateTime dat2 = DateTime.Parse(2004-12-30);
TimeSpan spanTime=(dat1-dat2);
DateTime dat2 = DateTime.Parse(2004-12-30);
TimeSpan spanTime=(dat1-dat2);
#9
感谢各位的热情帮助。
#1
System.DateTime.Compare 方法
#2
up
#3
谢谢.
DateTime dat1 = DateTime.Parse(2003-12-30);
DateTime dat2 = DateTime.Parse(2004-12-30);
if (dat1.CompareTo(dat2) > 0)
{
// dat1 > dat2;
}
else
{
// dat1 < dat2;
}
DateTime dat1 = DateTime.Parse(2003-12-30);
DateTime dat2 = DateTime.Parse(2004-12-30);
if (dat1.CompareTo(dat2) > 0)
{
// dat1 > dat2;
}
else
{
// dat1 < dat2;
}
#4
看看下面的代码:
if (DateTime.Compare(today,myHttpWebResponse.LastModified) == 0)
Console.WriteLine("\nThe requested URI entity was modified today");
else
if (DateTime.Compare(today,myHttpWebResponse.LastModified) == 1)
Console.WriteLine("\nThe requested URI was last modified on:{0}",
myHttpWebResponse.LastModified);
if (DateTime.Compare(today,myHttpWebResponse.LastModified) == 0)
Console.WriteLine("\nThe requested URI entity was modified today");
else
if (DateTime.Compare(today,myHttpWebResponse.LastModified) == 1)
Console.WriteLine("\nThe requested URI was last modified on:{0}",
myHttpWebResponse.LastModified);
#5
如果要知道两个日期的差值,又该如何?
#6
datediff也行啊。 :)
#7
DateTime dat1 = DateTime.Parse(2003-12-30);
DateTime dat2 = DateTime.Parse(2004-12-30);
if (DateTime.Compare(dat1 ,dat2 ) > 0)
{
// dat1 > dat2;
}
这样的写法比较正统,呵呵。
datediff的用法是怎么用的,请(易江流之梵炎) 指教。
DateTime dat2 = DateTime.Parse(2004-12-30);
if (DateTime.Compare(dat1 ,dat2 ) > 0)
{
// dat1 > dat2;
}
这样的写法比较正统,呵呵。
datediff的用法是怎么用的,请(易江流之梵炎) 指教。
#8
DateTime dat1 = DateTime.Parse(2003-12-30);
DateTime dat2 = DateTime.Parse(2004-12-30);
TimeSpan spanTime=(dat1-dat2);
DateTime dat2 = DateTime.Parse(2004-12-30);
TimeSpan spanTime=(dat1-dat2);
#9
感谢各位的热情帮助。