Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Time Conversion #68

Open
ndrohith09 opened this issue Oct 20, 2022 · 4 comments
Open

Time Conversion #68

ndrohith09 opened this issue Oct 20, 2022 · 4 comments
Assignees
Labels
easy question Further information is requested

Comments

@ndrohith09
Copy link
Member

Given a time in 12-hour AM/PM format, convert it to military (24-hour) time.

Note:

  • 12:00:00AM on a 12-hour clock is 00:00:00 on a 24-hour clock.
  • 12:00:00PM on a 12-hour clock is 12:00:00 on a 24-hour clock.

Example

s = '12:01:00PM

Return '12:01:00'.

s = '12:01:00AM

Return '00:01:00'.

Function Description

Complete the timeConversion function in the editor below. It should return a new string representing the input time in 24 hour format.

timeConversion has the following parameter(s):

  • string s: a time in 12 hour format

Returns

  • string: the time in 24 hour format

Input Format

A single string s that represents a time in 12-hour clock format (i.e.: hh:mm:ss:AM or hh:mm:ssPM).

Constraints

  • All input times are valid

Sample Input 0

07:05:45PM

Sample Output 0

19:05:45
@ndrohith09 ndrohith09 added question Further information is requested easy labels Oct 20, 2022
@Yogiraj587
Copy link
Contributor

@ndrohith09 Can u assign me the issue ???

@samarjeetvashistha
Copy link
Contributor

I want to solve it in c++

samarjeetvashistha added a commit to samarjeetvashistha/hacktoberfest that referenced this issue Oct 21, 2022
This was referenced Oct 22, 2022
@skandhavs
Copy link
Contributor

Hi I would like to solve this in C ?? Can you please assign it to me??

@mohan-warrior
Copy link
Contributor

I would like to solve this problem using ruby

mohan-warrior added a commit to mohan-warrior/hacktoberfest that referenced this issue Oct 30, 2022
thekavikumar added a commit that referenced this issue Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
easy question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants