Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

convert_time_from_24-hour_to_12-hour_format rust program #4789

Merged
merged 8 commits into from
Dec 2, 2023
Merged

convert_time_from_24-hour_to_12-hour_format rust program #4789

merged 8 commits into from
Dec 2, 2023

Conversation

SaideepKondur
Copy link
Contributor

📑 Description

I've added a Rust program that converts time from 24-hour to 12-hour format. The user is prompted to input the time in the 24-hour format (HH:MM:SS), and the program outputs the time in the 12-hour format, including AM or PM.

Here's an example of the conversion:

Input: 12:05:45
Output: 12:05:45PM

The solution utilizes standard input/output for user interaction and performs the conversion logic in Rust.

🐞 Related Issue

Closes #3220

@SaideepKondur SaideepKondur requested review from a team, 0ME9A and grraghav120 and removed request for a team November 29, 2023 18:43
Copy link

vercel bot commented Nov 29, 2023

@SaideepKondur is attempting to deploy a commit to the Codinasion Team on Vercel.

A member of the Team first needs to authorize it.

@SaideepKondur
Copy link
Contributor Author

@harshraj8843 It is asking for vercel authorization to approve. Could you kindly look into it and provide me with any leads to approve the merge

Copy link
Contributor

@0ME9A 0ME9A left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enhance time conversion and add input validation

@SaideepKondur, the current implementation of the time conversion program is almost correct, such as the accurate conversion of valid 24-hour input to the 12-hour format. However, there are a couple of areas where input validation is lacking.

Positive Aspects:

  • Accurate conversion of valid 24-hour input to 12-hour format.
  • Proper determination of AM or PM.

The program should validate:

  • Validate that the parsed hour is between 0 and 23.
  • Validate that the parsed minute is between 0 and 59.
  • Validate that the parsed second is between 0 and 59.

This ensures that only valid 24-hour time formats are accepted, preventing errors like "10203:123:3232" from being processed.

@SaideepKondur, please review and update the required changes. Feel free to reach out if you have any questions or if further adjustments are needed.

Screenshot 2023-11-30 104036

Copy link

changeset-bot bot commented Dec 1, 2023

⚠️ No Changeset found

Latest commit: a555ca5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

validated hours, minutes and seconds format in Rust program to convert time from 24-hour to 12-hour format
Copy link
Contributor Author

@SaideepKondur SaideepKondur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validated hours, minutes and seconds format in Rust program to convert time from 24-hour to 12-hour format

@SaideepKondur
Copy link
Contributor Author

@0ME9A I have validated hours, minutes and seconds format in Rust program to convert time from 24-hour to 12-hour format. I have changed the previous file. Kindly have a look and let me know if any changes are required. Do consider merging it. Thank you

Copy link
Contributor

@0ME9A 0ME9A left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hats off to @SaideepKondur for an exceptional job on resolving Issue #3220! 🎉 I'm truly impressed with the code quality and the effective solution provided. Your attention to detail and commitment to excellence shine through. 👏 This is a significant contribution that greatly enhances our project.

Thanks a million for your dedication and hard work!

Best,
@0ME9A

@SaideepKondur
Copy link
Contributor Author

Thanks a lot @0ME9A. @grraghav120 kindly approve the merge since merging requires 2 approving reviews. And also Vercel is asking for authorization.

Added Haskell program to print numbers from 1 to n without using a loop #3742.
@0ME9A 0ME9A merged commit d9fd093 into codinasion-archive:master Dec 2, 2023
1 of 2 checks passed
@0ME9A
Copy link
Contributor

0ME9A commented Dec 2, 2023

Happy 😊

@SaideepKondur
Copy link
Contributor Author

@0ME9A Yes!!!, Thanks a lot 😊

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Program]: Write a Rust program to convert time from 24-hour to 12-hour format
3 participants