-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.html
12 lines (12 loc) · 1.46 KB
/
task.html
1
2
3
4
5
6
7
8
9
10
11
12
<h2>12 and 24</h2>
<html>
<head></head>
<body>
<p>Write a function <code class="java">format_time</code> that takes a <code class="java">datetime</code> object and formats its time component in a 24-hour format and a 12-hour format. The function doesn't return anything, instead, it should print the resulting strings, first the one with a 24-hour clock and then a 12-hour one. See the provided examples for the details of the format.</p>
<p>Note, however, that you do NOT need to call the function or process the input.</p>
</body>
</html><br><b>Sample Input:</b><br><pre><code class="language-no-highlight">20:05</code></pre><br><b>Sample Output:</b><br><pre><code class="language-no-highlight">24h 20:05<br>12h 08:05</code></pre><br><br><b>Sample Input:</b><br><pre><code class="language-no-highlight">12:07</code></pre><br><b>Sample Output:</b><br><pre><code class="language-no-highlight">24h 12:07<br>12h 12:07</code></pre><br><br><b>Sample Input:</b><br><pre><code class="language-no-highlight">23:59</code></pre><br><b>Sample Output:</b><br><pre><code class="language-no-highlight">24h 23:59<br>12h 11:59</code></pre><br><br><br><font color="gray">Memory limit: 256 MB</font><br><font color="gray">Time limit: 15 seconds</font><br><br>
<b>Caution</b><br><br>
You may see errors in your code or execution results due to missing context. Don’t worry about it, just write the solution and press Check.
<br><br>
<a href="https://hyperskill.org/learn/step/9814">Show topic summary</a>