Ok, let's put some order:
The standard support both types that is:
Dates as a specific point in time since year 0000 and until year 9999.
Or
Durations which may describe a timespan between two dates or an arbiter duration/timespan which is not between two specific dates. Luckily when you specify durations the standard is much more flexible than with dates :)
So how can we tell the difference between a duration which belong between dates and an arbiter duration?
Simple: if you specified "P1Y" which is one year - that is exactly what you got.
If you want to calculate how much this 1 year has in days - that will be depended on the starting date you are applying this one year upon.
In example, if say the start date is 1/1/2010 (So February has 28 days which is normal) your 1 year value in calculation will yield 365 days.
But if say the start date is 1/1/2012 (So February has 29 days due to leap year) your 1 year value will yield 366 days in it...
But in both cases you wanted 1 year - and you got 1 year. Therefore the 1st thing is not to use years in duration in your case since what you really want is to specify the equivalent of 40000000 in seconds - just shortly... so our next alternative is to specify it in days and the .962 as a part of one day:
40000000 seconds is 462 days, 23 hours, 6 minutes and 40 seconds and according to what I read in the ISO-8601 this can be specified as duration like that: "P462DT23H6M40S" or you can simply specify "PT40000000S" or even "P462.962D" - all goes in duration.
To ease the pain of calculating you can use this very simple C# Line:
var timespan = new TimeSpan(0, 0, 40000000);
Simply put a breakpoint after it and look at the internals the Timespan class calculated for you.
Putting those into ISO-8601 format is rather easy after that point.
Oh and last thing - yes you can specify fractions too - such as "P0.5Y" to specify half year.