Displaying the build date

前端 未结 25 2455
感动是毒
感动是毒 2020-11-22 11:36

I currently have an app displaying the build number in its title window. That\'s well and good except it means nothing to most of the users, who want to know if they have t

25条回答
  •  醉话见心
    2020-11-22 12:36

    I used Abdurrahim's suggestion. However, it seemed to give a weird time format and also added the abbreviation for the day as part of the build date; example: Sun 12/24/2017 13:21:05.43. I only needed just the date so I had to eliminate the rest using substring.

    After adding the echo %date% %time% > "$(ProjectDir)\Resources\BuildDate.txt"to the pre-build event, I just did the following:

    string strBuildDate = YourNamespace.Properties.Resources.BuildDate;
    string strTrimBuildDate = strBuildDate.Substring(4).Remove(10);
    

    The good news here is that it worked.

提交回复
热议问题