Click here to Skip to main content
15,896,455 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Which part of CMOS did they not understand? Pin
Ron Anders4-Oct-17 14:54
Ron Anders4-Oct-17 14:54 
GeneralRe: Which part of CMOS did they not understand? Pin
rbuchana4-Oct-17 15:43
rbuchana4-Oct-17 15:43 
GeneralRe: Which part of CMOS did they not understand? Pin
Ron Anders4-Oct-17 18:22
Ron Anders4-Oct-17 18:22 
GeneralRe: Which part of CMOS did they not understand? Pin
CodeWraith4-Oct-17 20:53
CodeWraith4-Oct-17 20:53 
GeneralRe: Which part of CMOS did they not understand? Pin
PIEBALDconsult5-Oct-17 16:24
mvePIEBALDconsult5-Oct-17 16:24 
GeneralSo there I was... PinPopular
#realJSOP4-Oct-17 6:52
professional#realJSOP4-Oct-17 6:52 
GeneralRe: So there I was... Pin
Ravi Bhavnani4-Oct-17 7:09
professionalRavi Bhavnani4-Oct-17 7:09 
GeneralRe: So there I was... Pin
#realJSOP4-Oct-17 7:34
professional#realJSOP4-Oct-17 7:34 
I created an extension method to parse it...
C#
public static class ExtendTimeSpan
{
    public static TimeSpan ParseFromFormattedInt(int value)
    {
        return new TimeSpan(0).ParseFromFormattedInt(value);
    }

    public static TimeSpan ParseFromFormattedInt(this TimeSpan span, int value)
    {
        TimeSpan result = new TimeSpan(0);
        string timeString = value.ToString();
        string padding    = new String('0', 6 - timeString.Length); 
        timeString = ((timeString.Length < 6) ? string.Concat(padding, timeString) : timeString).Insert(4, ":").Insert(2,":");
        try
        {
            result     = TimeSpan.ParseExact(timeString, "g", CultureInfo.CurrentCulture);
        }
        catch (Exception)
        {
        }
        return result;
    }
}
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

GeneralRe: So there I was... Pin
Ravi Bhavnani4-Oct-17 7:49
professionalRavi Bhavnani4-Oct-17 7:49 
GeneralRe: So there I was... Pin
Richard Deeming4-Oct-17 9:34
mveRichard Deeming4-Oct-17 9:34 
GeneralRe: So there I was... Pin
#realJSOP5-Oct-17 1:15
professional#realJSOP5-Oct-17 1:15 
GeneralRe: So there I was... Pin
#realJSOP5-Oct-17 2:33
professional#realJSOP5-Oct-17 2:33 
GeneralRe: So there I was... Pin
Richard Deeming5-Oct-17 3:39
mveRichard Deeming5-Oct-17 3:39 
GeneralRe: So there I was... Pin
Tim Carmichael4-Oct-17 7:27
Tim Carmichael4-Oct-17 7:27 
GeneralRe: So there I was... Pin
#realJSOP4-Oct-17 7:37
professional#realJSOP4-Oct-17 7:37 
GeneralRe: So there I was... Pin
Herbie Mountjoy11-Oct-17 2:51
professionalHerbie Mountjoy11-Oct-17 2:51 
GeneralRe: So there I was... Pin
OriginalGriff4-Oct-17 8:05
mveOriginalGriff4-Oct-17 8:05 
GeneralRe: So there I was... Pin
dandy724-Oct-17 8:14
dandy724-Oct-17 8:14 
GeneralRe: So there I was... Pin
Jim_Snyder5-Oct-17 3:27
professionalJim_Snyder5-Oct-17 3:27 
GeneralRe: So there I was... Pin
#realJSOP4-Oct-17 8:16
professional#realJSOP4-Oct-17 8:16 
GeneralRe: So there I was... Pin
Mike Winiberg4-Oct-17 20:22
professionalMike Winiberg4-Oct-17 20:22 
GeneralRe: So there I was... Pin
jsc424-Oct-17 22:49
professionaljsc424-Oct-17 22:49 
GeneralRe: So there I was... Pin
Mike Winiberg5-Oct-17 0:25
professionalMike Winiberg5-Oct-17 0:25 
GeneralRe: So there I was... Pin
Michael Martin5-Oct-17 0:59
professionalMichael Martin5-Oct-17 0:59 
GeneralRe: So there I was... Pin
User 84204-Oct-17 10:53
User 84204-Oct-17 10:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.