none
How Microsoft Project converts decimal to ISO8601 format string RRS feed

  • Question

  • In my MS project 2013 file I have got resource assignment (material) and when I set Units to 408.47 in xml it is serialized as xml element

    <Work>PT408H25M12S</Work>
    

    How to convert decimal d = 408.47 to string PT408H25M12S ?

    Tuesday, September 17, 2013 4:12 PM

All replies

  • PKB Info,

    For a material resource the "work" value in XML will appear as:

    <Work>PT408H28M12S</Work> 

    and

    <Units>408.47</Units>

    Also note that the resource type for a material resource will appear in XML as:

    <Type>0</Type> 

    Hope this helps.

    John

    Tuesday, September 17, 2013 8:27 PM
  • Hey there,

       To make ISO8601 compatible string I use a technique like this (Powershell):

    [System.XML.XmlConvert]::ToString([System.TimeSpan]::FromHours(408.25))

    P17DT15M

    Which is perhaps close enough.

    Cheers,

       James.


    James Boman - http://www.boman.biz Software Consultant for IPMO - http://www.ipmo.com.au

    Tuesday, September 17, 2013 11:33 PM