小编Mic*_*les的帖子

在C#中将时间转换为格式化字符串

Time.ToString("0.0")显示为十进制"1.5"代替1:30.如何让它以时间格式显示?

private void xTripSeventyMilesRadioButton_CheckedChanged(object sender, EventArgs e)
{
    //calculation for the estimated time label
    Time = Miles / SeventyMph; 
    this.xTripEstimateLabel.Visible = true;
    this.xTripEstimateLabel.Text = "Driving at this speed the estimated travel time in hours is: " + Time.ToString("0.0") + " hrs";
}
Run Code Online (Sandbox Code Playgroud)

c# time string-formatting

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

c# ×1

string-formatting ×1

time ×1