Editing
Show current time
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
How to show current time == 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= <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> == Windows DOS == Result of {{kbd | key= date/t}} ({{Win}}) (parameter: /t will not ask you to change the current date). By OS: * XP in English: {{kbd | key=Thu 05/03/2012}} * XP in Mandarin: {{kbd | key=2012/05/03 星期四}} * Windows 8, Windows Server 2008 R2 in Mandarin: {{kbd | key=2014/07/01 週二}} * Windows Server 2019 Standard in Mandarin: {{kbd | key=週五 2024/03/01}} * Windows 10 in Mandarin: {{kbd | key=週一 2019/12/02}} Result of {{kbd | key= <nowiki>prompt $d $t $_$P$G</nowiki>}} on {{Win}}<ref>[http://stackoverflow.com/questions/673523/how-to-measure-execution-time-of-command-in-windows-command-line batch file - How to measure execution time of command in windows command line? - Stack Overflow]</ref>). By OS: * Windows 10 in Mandarin: {{kbd | key=2017/02/03 週五 15:35:31.61}} * Windows Server 2019 Standard in Mandarin: {{kbd | key=週五 2024/03/01 16:43:30.32}} Result of {{kbd | key= <nowiki>echo %DATE% %TIME%</nowiki>}} {{Win}}. By OS: * Windows Server 2019 Standard in Mandarin: {{kbd | key=週五 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%' <pre>command: php -r "echo date('Y-m-d);" > today.txt SET /P TODAY =< today.txt ECHO %TODAY% </pre> output: `{{Template:Today}}` == PHP & MySQL == [[PHP and MySQL syntax]] [[PHP_and_MySQL_syntax#timestamp | timestamp in PHP and MySQL syntax]] == Related pages == [[Time server]] == References == <references /> [[Category:Programming]] [[Category:Linux]] [[Category:Windows]] [[Category:Time river]]
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Exclaim
(
edit
)
Template:Kbd
(
edit
)
Template:Linux
(
edit
)
Template:Mac
(
edit
)
Template:Today
(
edit
)
Template:Win
(
edit
)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information