Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 215339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:27:40+00:00 2026-05-11T18:27:40+00:00

How do you elegantly format a timespan to say example 1 hour 10 minutes

  • 0

How do you elegantly format a timespan to say example “1 hour 10 minutes” when you have declared it as :

TimeSpan t = new TimeSpan(0, 70, 0);

?

I am of course aware that you could do some simple maths for this, but I was kinda hoping that there is something in .NET to handle this for me – for more complicated scenarios

Duplicate of How can I String.Format a TimeSpan object with a custom format in .NET?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:27:40+00:00Added an answer on May 11, 2026 at 6:27 pm

    There is no built-in functionality for this, you’ll need to use a custom method, something like:

    TimeSpan ts = new TimeSpan(0, 70, 0);
    String.Format("{0} hour{1} {2} minute{3}", 
                  ts.Hours, 
                  ts.Hours == 1 ? "" : "s",
                  ts.Minutes, 
                  ts.Minutes == 1 ? "" : "s")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some functions that deal with data provided in array format. These functions
Let's say I have a format string XXX - XXX - XXXX (to format
I have std::string with the follwing format std::string s = some string with @lable
I have an xml which contains some keywords. The format of the xml this:
I have a list that contains dates that are in GMT format. What is
I have a Java program that spits out, in space-separated hexadecimal format, 16 bytes
I have some strings of xxh:yym format where xx is hours and yy is
An offshoot of How do I elegantly print the date in RFC822 format in
On Jon's site he has thisvery elegantly designed singleton in C# that looks like
I have seen several places in stackoverflow where folks have elegantly and easily turned

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.