為了解決這種問題,我的做法是在首頁引入以下的檔案:
- <script src="lastBuild.js"></script>
- <div id="lastBuild"></div>
- <script>
- $(function () {
- $("#lastBuild").text("lastBuild: " + lastBuild);
- });
- </script>
- set output=../lastBuild.js
- echo | set /p dummy = "var lastBuild = '" > %output%
- FOR /f %%a in ('WMIC OS GET LocalDateTime ^| find "."') DO set D=%%a
- set timestamp=%D:~0,4%/%D:~4,2%/%D:~6,2%T%D:~8,2%:%D:~10,2%:%D:~12,2%';
- echo | set /p dummy = %timestamp% >> %output%
- var lastBuild = '2016/05/18T17:09:15';
- lastBuild: 2016/05/18T17:09:15
沒有留言:
張貼留言