We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Warmup
- Time Conversion
- Discussions
Time Conversion
Time Conversion
Sort by
recency
|
5166 Discussions
|
Please Login in order to post a comment
Java 8 based with 2 different approaches
Java:
string timeConversion(string s) { string hour = s.substr(0, 2); // starts from 0 and len = 2 string amPM = s.substr(8); // from 0 to the rest
}
Java 15