[WebMethod(Description = "返回白天还是黑夜")]
public int DayOrNight(string datetime)
{
if (System.DateTime.Now.TimeOfDay >= System.Convert.ToDateTime(datetime).TimeOfDay && System.DateTime.Now.TimeOfDay < System.Convert.ToDateTime(datetime).TimeOfDay)
return 1;
else
return 2;
}
if (DateTime.Now.TimeOfDay >= Convert.ToDateTime("08:00").TimeOfDay && DateTime.Now.TimeOfDay < Convert.ToDateTime("19:59").TimeOfDay)
return 1
else
return 2