using System; 
namespace StringApplication 
{
class StringProg 
{ 
static void Main(string[] args) 
{ 
string str = "2018-08-07 09:50"; 
Console.WriteLine(str); 
string substr = str.Substring(10); 
string str2="10:30";
Console.WriteLine(substr); 
Console.WriteLine("compare "+substr+" with "+str2);
DateTime dt1=Convert.ToDateTime(substr);
DateTime dt2=Convert.ToDateTime(str2);
if(DateTime.Compare(dt1,dt2)>0)    
Console.WriteLine(substr+" later than "+str2);    
else
Console.WriteLine(substr+" earlier "+str2);    
Console.ReadKey() ; 
} 
} 
}

 

相关文章:

  • 2021-08-11
  • 2021-11-23
  • 2021-09-29
  • 2021-11-11
  • 2020-04-10
  • 2021-09-29
  • 2021-08-26
  • 2021-11-17
猜你喜欢
  • 2021-11-13
  • 2021-11-21
  • 2022-01-10
  • 2021-12-13
  • 2021-04-22
  • 2021-11-13
  • 2021-10-06
  • 2021-09-29
相关资源
相似解决方案