时间转秒
<h1>时间转秒</h1>
<h2>功能描述</h2>
<p>将时间字符串转换为总秒数。</p>
<h2>输入参数</h2>
<ul>
<li><strong>时间</strong>:字符串(必填,如 <code>&quot;15:30:45&quot;</code>)。</li>
</ul>
<h2>输出结果</h2>
<ul>
<li><strong>执行结果</strong>:
- <code>true</code>(转换成功时)。
- <code>false</code>(转换失败时)。</li>
</ul>
<h2>日志记录</h2>
<ul>
<li>输入参数:
- <code>时间: &quot;15:30:45&quot;</code></li>
<li>输出结果:
- <code>执行结果: true</code> 或 <code>false</code></li>
<li>日志信息:
- <code>秒数: 55845</code>(转换成功时)。
- <code>无法解析时间[15:30:45]</code>(转换失败时)。</li>
</ul>
<h2>示例</h2>
<h3>场景 1:转换成功</h3>
<ul>
<li><strong>输入参数</strong>:
- 时间:<code>&quot;15:30:45&quot;</code></li>
<li><strong>输出结果</strong>:
- <code>执行结果: true</code></li>
<li><strong>日志输出</strong>:
- <code>秒数: 55845</code></li>
</ul>
<h3>场景 2:转换失败</h3>
<ul>
<li><strong>输入参数</strong>:
- 时间:<code>&quot;无效时间&quot;</code></li>
<li><strong>输出结果</strong>:
- <code>执行结果: false</code></li>
<li><strong>日志输出</strong>:
- <code>无法解析时间[无效时间]</code></li>
</ul>