Show current time
Jump to navigation
Jump to search
How to show current time
Linux BASH[edit]
- date (Linux
) output the system date: 'Thu Oct 25 15:05:10 CST 2012' [1][2]
- TZ=Asia/Taipei date (Linux
) output the time from the Taipei/CST timezone [3]
Windows DOS[edit]
Result of date/t (Win ) (parameter: /t will not ask you to change the current date). By OS:
- XP in English: Thu 05/03/2012
- XP in Mandarin: 2012/05/03 星期四
- Windows 8, Windows Server 2008 R2 in Mandarin: 2014/07/01 週二
- Windows Server 2019 Standard in Mandarin: 週五 2024/03/01
- Windows 10 in Mandarin: 週一 2019/12/02
Result of prompt $d $t $_$P$G on Win [4]). By OS:
- Windows 10 in Mandarin: 2017/02/03 週五 15:35:31.61
- Windows Server 2019 Standard in Mandarin: 週五 2024/03/01 16:43:30.32
Result of echo %DATE% %TIME% Win . By OS:
- Windows Server 2019 Standard in Mandarin: 週五 2024/03/01 16:43:30.32
If PHP was installed. (1) Saved the PHP execution result to the file `today.txt` (2) Read the file content and save to the variable '%TODAY%'
command: php -r "echo date('Y-m-d);" > today.txt SET /P TODAY =< today.txt ECHO %TODAY%
output: `2025-10-05`
PHP & MySQL[edit]
timestamp in PHP and MySQL syntax