Show current time: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (→Linux BASH) |
||
| Line 2: | Line 2: | ||
== Linux BASH == | == Linux BASH == | ||
* {{kbd | key= date}} ({{Linux}}) output the system date: Thu Oct 25 15:05:10 CST 2012 <ref>[http://linux.vbird.org/linux_server/0440ntp.php 鳥哥的 Linux 私房菜 -- NTP 時間伺服器]</ref><ref>[https://en.wikipedia.org/wiki/DATE_(command) DATE (command) - Wikipedia, the free encyclopedia]</ref> | * {{kbd | key= date}} ({{Linux}}) output the system date: 'Thu Oct 25 15:05:10 CST 2012' <ref>[http://linux.vbird.org/linux_server/0440ntp.php 鳥哥的 Linux 私房菜 -- NTP 時間伺服器]</ref><ref>[https://en.wikipedia.org/wiki/DATE_(command) DATE (command) - Wikipedia, the free encyclopedia]</ref> | ||
** {{kbd | key= <nowiki>echo $(date '+%Y-%m-%d %H:%M:%S')</nowiki>}} ({{Linux}}& {{Mac}}) example output: '{{Template:Today}} {{CURRENTTIME}}:06' {{exclaim}} server timezone dependent | |||
* {{kbd | key= TZ=Asia/Taipei date}} ({{Linux}}) output the time from the Taipei/CST timezone <ref>[http://unix.stackexchange.com/questions/48101/how-can-i-have-date-output-the-time-from-a-different-timezone How can I have `date` output the time from a different timezone? - Unix & Linux Stack Exchange]</ref> | * {{kbd | key= TZ=Asia/Taipei date}} ({{Linux}}) output the time from the Taipei/CST timezone <ref>[http://unix.stackexchange.com/questions/48101/how-can-i-have-date-output-the-time-from-a-different-timezone How can I have `date` output the time from a different timezone? - Unix & Linux Stack Exchange]</ref> | ||
Revision as of 17:38, 2 December 2019
Multiple approached to show current time
Linux BASH
- 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
output: OS in English: Thu 05/03/2012 OS in Mandarin Chinese (XP): 2012/05/03 星期四 OS in Mandarin Chinese (Windows 8, Windows Server 2008 R2): 2014/07/01 週二 OS in Mandarin Chinese (Windows 10): 週一 2019/12/02
- prompt $d $t $_$P$G (Win
[4])
output: OS in Mandarin Chinese (Windows 10): 2017/02/03 週五 15:35:31.61
PHP & MySQL
- related pages: Time server, timestamp in PHP and MySQL syntax