111,125
社区成员
发帖
与我相关
我的任务
分享
fee_strat = rs["car_fee_start"].ToString();
string fee_card_id = l_fee_card_id.Text.ToString(); ;
string fee_sql_card = "select * from car_park_fee where
car_fee_nums='" + fee_card_id + "' and datediff(d,car_fee_start,getdate())=0
and car_fee_flag=1";
string now_sql = "Select getdate()";
SqlCommand command_time = new SqlCommand(now_sql, conn_time);
conn_time.Open();
SqlDataReader rs_time = command_time.ExecuteReader();
if (rs_time.Read())
{
now_time = rs_time.GetValue(0).ToString();
}
rs_time.Close();
conn_time.Close();
TimeSpan car_fee = DateTime.Parse(now_time) - DateTime.Parse(fee_strat);
}
/*
2
1
*/
void Main()
{
DateTime dt1=DateTime.Now.AddHours(1).AddMinutes(40);
DateTime dt2=DateTime.Now.AddHours(1).AddMinutes(10);
double d1=(dt1-DateTime.Now).TotalHours;
double d2=(dt2-DateTime.Now).TotalHours;
int i1=(int)d1+((d1-(int)d1)>0.25?1:0);
int i2=(int)d2+((d2-(int)d2)>0.25?1:0);
Console.WriteLine(i1);
Console.WriteLine(i2);
}