File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -189,12 +189,12 @@ str.replaceAll(" ", "_");
189
189
### Write a function which can convert the time input given in 12 hours format to 24 hours format
190
190
``` js
191
191
// Example
192
- console . log ( convertTo24HrsFormat (" 12:10AM" )); // 00:10
193
- console . log ( convertTo24HrsFormat (" 5:00AM" )); // 05:00
194
- console . log ( convertTo24HrsFormat (" 12:33PM" )); // 12:33
195
- console . log ( convertTo24HrsFormat (" 01:59PM" )); // 13:59
196
- console . log ( convertTo24HrsFormat (" 10 :8PM" )) ; // 22 :08
197
- console . log ( convertTo24HrsFormat (" 10:02PM" )); // 22:02
192
+ convertTo24HrsFormat (" 12:10AM" ); // 00:10
193
+ convertTo24HrsFormat (" 5:00AM" ); // 05:00
194
+ convertTo24HrsFormat (" 12:33PM" ); // 12:33
195
+ convertTo24HrsFormat (" 01:59PM" ); // 13:59
196
+ convertTo24HrsFormat (" 11 :8PM" ); // 23 :08
197
+ convertTo24HrsFormat (" 10:02PM" ); // 22:02
198
198
```
199
199
200
200
- The check for 'AM' and 'PM' can be verified using ` endsWith ` String method
You can’t perform that action at this time.
0 commit comments