2 回答
TA贡献1777条经验 获得超10个赞
class MyDate
{
int hour;
public int Hour
{
get { return hour; }
set { hour = value; }
}
int min;
public int Min
{
get { return min; }
set { min = value; }
}
int sec;
public int Sec
{
get { return sec; }
set { sec = value; }
}
public DateTime AddSecond()
{
return DateTime.Now.AddSeconds(1);
}
public DateTime AddMin()
{
return DateTime.Now.AddMinutes(1);
}
public DateTime AddHour()
{
return DateTime.Now.AddHours(1);
}
public string ShowSecond()
{
return DateTime.Now.Second.ToString();
}
public string ShowMin()
{
return DateTime.Now.Minute.ToString();
}
public string ShowHour()
{
return DateTime.Now.Hour.ToString();
}
public string ShowAll()
{
return DateTime.Now.Hour.ToString() +":"+ DateTime.Now.Minute.ToString() +":"+ DateTime.Now.Second.ToString();
}
}
- 2 回答
- 0 关注
- 392 浏览
添加回答
举报