Unanswered How to query TFS for the creation date of a project

  • Wednesday, August 08, 2012 8:13 PM
     
     

    I need to add the creation date to a report that I'm generating with VS 2010 / C#. I query the project collections, then projects for the names of the projects.

    What code would I use to get the 'date created' on a given project?

All Replies

  • Friday, August 10, 2012 7:13 AM
    Moderator
     
     

    Hi dachshund44,

    Thanks for your post!

    Do you want to query the creation date of a team project? If yes, please perform the following SQL query:

    SELECT [project_name],[last_update] FROM [Tfs_DefaultCollection].[dbo].[tbl_projects]
    WHERE [project_name]= 'ProjectName'

    TFS store Date Time as the UTC time in DB. TFS Server can works across the regions, the UTC time as the standard time for different areas. You should covert the UTC time back to the local time in your report code. Pleaser refer to this blog for it:

    http://keessrs.blogspot.com/2009/04/convert-utc-time-to-local-time.html

    Hope it helps!

    Best Regards,


    Cathy Kong [MSFT]
    MSDN Community Support | Feedback to us


  • Friday, August 17, 2012 9:09 PM
     
     

    What additional code is needed to connect to the DB? I haven't used this before. Does this require LINQ or a DataReader?

  • Sunday, August 19, 2012 2:50 PM
     
     
    Would this be easier to do by querying the WorkItems for the first item in a project's history?