[Question]
  [
# Challenge
You must output the current time continuously (until cancelled by an interrupt), once every second, by any of the following means:
* It must be in 24-hour or AM/PM format.
	+ If it is the former, it must be spaced out with colons (i.e. 15:47:36).
	+ If it is the latter, it must be spaced out with colons and have the AM/PM following (i.e. 3:47:36 PM)
* It may be pulled from the internet.
* It may be the system time.
* It must output any naturally accessible form of output which supports text that you choose.
* Output may have extra information aside of the time in it, but you *must* guarantee one, and only one, output of time per second.
* The continuous output must be a second apart - if you choose to wait until the second changes between outputs, that is fine. If you wait a second between each output, that is perfectly acceptable, despite the eventual loss of accuracy.
Since this is a catalog, languages created after this challenge are allowed to compete. Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language. Other than that, all the standard rules of [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") must be obeyed. Submissions in most languages will be scored in bytes in an appropriate preexisting encoding (usually UTF-8).
# Catalog
The Stack Snippet at the bottom of this post generates the catalog from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
```
## Language Name, N bytes
```
where `N` is the size of your submission. If you improve your score, you *can* keep old scores in the headline, by striking them through. For instance:
```
## Ruby, <s>104</s> <s>101</s> 96 bytes
```
If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the *last* number in the header:
```
## Perl, 43 + 2 (-p flag) = 45 bytes
```
You can also make the language name a link which will then show up in the snippet:
```
## [><>](http://esolangs.org/wiki/Fish), 121 bytes
```
```
var QUESTION_ID=65020,OVERRIDE_USER=44713;function answersUrl(e){return"//api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"//api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
```
```
body{text-align:left!important}#answer-list,#language-list{padding:10px;float:left}table thead{font-weight:700}table td{padding:5px}
```
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>
```
  
[Answer]
# Minecraft 1.8.7, 7 + 8 = 15 [blytes](https://codegolf.meta.stackexchange.com/a/7397/44713) (bytes + blocks)
Only one command block involved:
```
xp 1 @p
```
Output goes to the client console like so:
[![times](https://i.stack.imgur.com/TYtQk.png)](https://i.stack.imgur.com/TYtQk.png)
As part of the normal output.
This is the system:
[![the system](https://i.stack.imgur.com/VqYkH.png)](https://i.stack.imgur.com/VqYkH.png)
`xp` gives a specified amount of experience to a specified player with the syntax `xp <amount> <player>`. I'm pretty sure this is the smallest command that has singular output that I can get, now.
[Answer]
# JavaScript, 32 bytes
```
setInterval("alert(Date())",1e3)
```
Uses the fact that [setInterval](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval) evaluates code. This is not recommended, but when was that a concern in code golf?
`Date()` returns the current time and date in a format like this (may vary per system).
```
 Wed Jul 28 1993 14:39:07 GMT-0600 (PDT)
```
[Answer]
## sh (+ watch), 11 bytes
Script:
```
watch -n1 .
```
(no trailing newline)
Output:
```
Every 1,0s: . (SPACES) Sat Nov 28 19:07:51 2015
```
The amount of spaces depends on the terminal width.
Tested on Debian8 and NetBSD7.
[Answer]
# [Snap](https://snap.berkeley.edu/snap/#open:http://snap.berkeley.edu/snapsource/tools.xml), ~~8~~ ~~7~~ 6 blocks
[![](https://i.stack.imgur.com/XULyY.jpg)](https://i.stack.imgur.com/XULyY.jpg)  
(source: [cubeupload.com](https://i.cubeupload.com/TpGafK.jpg))  
  
(Yes, I changed it in MS Paint because I was too lazy to make another screenshot. So what? At least it's readable.)  
click the script to run
  
24-hour clock.
[Answer]
## Python 2, 47 bytes
```
from time import*
while[sleep(1)]:print ctime()
```
No online link because ideone times out (huehuehue) before printing anything.
Thanks to @xsot for the `while[sleep(1)]` trick and the `ctime` trick.
Prints out the current date and time like so: `Fri Nov 27 21:23:02 2015`
[Answer]
# Javascript ES6, 43 39 bytes
```
setInterval(_=>console.log(Date()),1e3)
```
Works with my current time settings (which have not been changed for some time, thank you), at least.
4 bytes saved by Conor O'Brien.
[Answer]
# Perl, Command Line, 24 bytes
```
sleep(say)while$_=gmtime
```
This must be run from the command line, as `perl -E'sleep(say)while$_=gmtime'` (on windows, use double quotes instead). The date will be output along with the time, which [seems to be allowed](https://codegolf.stackexchange.com/a/65022).
---
## Perl, 25 bytes
```
sleep print$/.gmtime;do$0
```
In a scalar context, `gmtime` will return a string similar to `Sat Nov 28 10:23:05 2015`. The result from `print`, always 1, is used as the parameter for `sleep`. `do$0` is used to execute the script again, after the timer has finished. 
[Answer]
# [Arcy√≥u](https://github.com/nazek42/arcyou), 27 bytes
```
(@ t(pn(zz 1)(p(st %H:%M:%S
```
I had to kludge together two new functions for this challenge, `zz` and `st`.
`pn`: Exactly like Lisp's `progn`.
`zz`: Direct link to Python's `time.sleep`.
`st`: Direct link to Python's `time.strftime`.
Normally, quotes would be necessary around the format string, but since there are no spaces, it's parsed as a symbol. The interpreter evaluates undefined symbols as themselves, so we get a string. 
[Answer]
# Bash, ~~51~~ ~~31~~ ~~24~~ ~~21~~  20 bytes
Thanks to @quartata for some very helpful comments. Thank you @Dennis for clarifications and for chopping off even more bytes. Thank you @VoteToClose for clarifying the rules (which apparently I am bad at reading) further reducing the bytes.
`date`  displays the the full date with a 24 hour clock. `sleep 1` sleeps for a second. `exec $0` loops the script infinitely.
```
date;sleep 1;exec $0
```
[Answer]
# Befunge 98, 53 bytes
```
 v
v>"EMIT"4(>H.8,':,M.8,':,S:.8,d,
>:S-    !!k^
```
Notes:
1. This program does not zero-pad the numbers it prints.
2. This program prints a space and then a backspace character after every number, as the `.` command prints an implicit space at the end.
3. The size of the stack in this program grows every second, and thus it will eventually run out of memory.
4. This program will overwrite the previous time when it prints a new one. To make it print each time on a new line, change the `d` on the first line to an `a`
[Answer]
## mIRC 7.49 ~~20~~ 16 Bytes
```
/timer 0 1 $time
```
[Answer]
## AutoHotkey, 50 bytes
```
x::Send,% a!=A_Sec? A_Hour ":" A_Min ":" a:=A_Sec:
```
Notes: 
1. Requires you to hold `x` for continuous output.
2. Remove your finger from `x` to interrupt and end the output.
3. Output is in 24-hour format.
[Answer]
# C (on Linux x64), ~~179~~ ~~177~~ ~~175~~ ~~168~~ 159 bytes
```
#include<time.h>
#include<sys/time.h>
main(){struct timeval a;char b[9];for(;;){gettimeofday(&a,0);strftime(b,9,"%T",localtime(&a.tv_sec));puts(b);sleep(1);}}
```
Ungolfed:
```
#include <time.h>
#include <sys/time.h>
main(){
  struct timeval a;
  char b[9];
  for(;;){
    gettimeofday(&a, 0);
    strftime(b, 9, "%T",localtime(&a.tv_sec));
    puts(b);
    sleep(1);
  }
}
```
Only tested on, and likely only functions on, linux x64 (x32 might work, but other platforms probably won't).
The main difference between this program and the other posted C program is the use of linux-exclusive function calls, which, while terrible practice for real software, saves quite a few bytes...if you ignore all the compiler warnings.
[Answer]
# [Jolf](https://github.com/ConorOBrien-Foxx/Jolf), ~~14~~ ~~8~~ 7 bytes
Crossed out 14 is a striked 1? Naw, it will never catch on ;)
[Try it here!](http://conorobrien-foxx.github.io/Jolf/#code=VGFEI2B-Mg) Click run, do not click on anything else ^\_^ the page is highly... explosive. Yes. Fixed output system with update. 
```
TaD#`~2
```
(I added some constants, and `~1` to `~4` are powers of `10`.)
## Explanation
```
setInterval("alert(Date())",1000);
     T         a      D#   ` ~2
```
[Answer]
# PHP, 37 bytes
```
<?=date('G:i:s');header('refresh:1');
```
Outputs the formatted server time and sets the page to refresh every second.
Of course, it depends on your internet connection and how fast-repsonding your server is :)
[Demo](http://justachat.freevar.com/realtime.php)
[![](https://i.stack.imgur.com/sj1oZ.png)](https://i.stack.imgur.com/sj1oZ.png)
[Answer]
# [Dyalog APL](https://www.dyalog.com/), ~~27 18~~ 16 bytes
```
':',¬®‚éïTS‚ãÑ‚Üí‚â¢‚éïDL 1
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qKM9JDM39b@6lbrOoRWP@qaGBD/qbnnUNulR5yIgz8VHwRCk5j9IEQA)
`‚éïTS` Y M D h m s t  
`':',¬®` prepend : to each  
`‚ãÑ` new statement  
`‚éïDL 1` wait a second and return actual waited time; 1.0something seconds  
`‚â¢` tally the actual waited time, giving 1  
`‚Üí` go to line (1 = this line)
[Answer]
## [Perl 6](http://perl6.org), 29 bytes
The *right* way to do this:
```
Supply.interval(1).tap: -> $ {
  say join ':',.hour,.minute,.whole-second given DateTime.now
}
await Promise.new; # halt this thread indefinitely
```
```
22:21:58
22:21:59
22:22:0
22:22:1
22:22:2
‚Ä¶
```
The golfed version
```
loop {sleep say join ':',now.polymod(1,60,60,24)[3‚Ä¶1]} # 56 bytes
```
```
3:59:26
3:59:27
3:59:28
3:59:29
‚Ä¶
```
Since the output doesn't have to be restricted to just the time, I can make it quite a bit shorter.
```
loop {sleep say DateTime.now} # 29 bytes
```
```
2015-11-27T22:18:10-06:00
2015-11-27T22:18:11-06:00
2015-11-27T22:18:12-06:00
2015-11-27T22:18:13-06:00
‚Ä¶
```
[Answer]
## R, 38 bytes
```
repeat{Sys.sleep(1);print(Sys.time())}
```
This outputs the current time in the following format:
```
[1] "2015-11-28 07:34:01 CET"
```
[Answer]
## Powershell, 19 bytes
```
for(){date;sleep 1}
```
[Answer]
#  VBA, 69 Bytes
Getting the Time is easy, `now()` Only outputting every 1 second.... MUCH more verbose. 
This is the "Right" way of waiting 1 second in VBA. ***78 Bytes***
```
Sub a():Debug.Print Now():Application.Wait Now()+TimeValue("0:0:1"):a:End Sub
```
Or if you want to Cut some Corners and only being right 86% of the time is good enough ***63 Bytes***   
*adding one SigFig take you to 95% accurate and a third will get you to 99.36%*
```
Sub a():Debug.Print Now():Application.Wait Now()+1e-5:a:End Sub
```
If you want to get the above method to 100% then you need ***69 Bytes*** `(1/86400)`  
```
Sub a():Debug.Print Now():Application.Wait Now()+(1/86400):a:End Sub
```
All of these methods would stumble on a leap second Beacuse they do not wait for 1 second, But wait untill 1 second. At midnight when the clocks fall back an hour this clock will stop for 1 hour and then pick up where it left off. 
VBA does allow for the Sleep Method but your byte couter is Ruined. ***97 Bytes***
```
Declare Sub Sleep Lib "kernel32" (ByVal k as Long)
Sub a():Debug.Print Now():Sleep(1e3):a:End Sub
```
[Answer]
# JavaScript, ~~47~~ ~~38~~ 35 bytes
```
for(p=1;t=Date();p=t)t!=p&&alert(t)
```
## Explanation
Continuously checks if the time has changed then `alert`s if it has.
```
for(
  p=1;
  t=Date();
  p=t
)
  t!=p
    &&alert(t)
```
[Answer]
# AppleScript, ~~51~~ 35 bytes
```
repeat
log current date
delay 1
end
```
Pretty dang obvious. Prints the current date, which contains the time, delays a second, then continues.
[Answer]
# ùîºùïäùïÑùïöùïü, 13 chars / 25 bytes
```
ƒ§‚áÄ√¥·∂Å‚¨Æ+‚¨¨),1ùïú)
```
`[Try it here(Firefox only).](http://molarmanful.github.io/ESMin/interpreter.html?eval=false&input=&code=%C4%A4%E2%87%80%C3%B4%E1%B6%81%E2%AC%AE%2B%E2%AC%AC%29%2C1%F0%9D%95%9C%29)`
This is surprisingly readable.
[Answer]
# Dyalog APL, 36 bytes
Not very short this time.
```
{‚éï‚Üê1‚Üì‚àä'‚äÇ:‚äÉ,ZI2'‚éïFMT 3‚Üë3‚Üì‚éïTS‚ãÑ‚àá‚éïDL 1}1
```
This outputs 24-hour time, i.e.:
```
14:37:44
14:37:45
14:37:46
...
```
Explanation:
* `{`...`}1`: define a function and call it (the argument is ignored, but we need the function in order to call it recursively)
	+ `‚éïTS`: a system function that returns the current date and time, in the format *year - month - day - hour - minute - second - millisecond*. (`‚éïTS` = **t**ime**s**tamp)
	+ `3‚Üë3‚Üì`: drop the first 3 items (i.e. year - month - day) and then take the first 3 items that are left (hour - minute - second).
	+ `'‚äÇ:‚äÉ,ZI2'‚éïFMT`: format each number as a two-digit integer (`I2`) with leading zeroes (`Z`), prefixed by a colon (`‚äÇ:‚äÉ`). (This results in a matrix.)
	+ `‚àä`: Get all the elements in the matrix, in row order. (This gives a vector, in this case a string.)
	+ `1‚Üì`: drop the first character (which is an extra `:`)
	+ `‚éï‚Üê`: output it
	+ `‚éïDL 1`: then wait one second (`‚éïDL` = **d**e**l**ay)
	+ `‚àá`: call the function recursively
[Answer]
# QBasic, 18 bytes
```
?TIME$
SLEEP 1
RUN
```
[Answer]
# Haskell, ~~98~~ ~~96~~ 85 bytes
```
import GHC.Conc
import Data.Time
m@main=getCurrentTime>>=print>>threadDelay(10^6)>>m
```
Alternate version using do notation:
```
main = do
  time <- getCurrentTime
  print time
  threadDelay 1000000
  main
```
Gets the current time with `getCurrentTime` from the `Data.Time` library, then pipes it into `print`, waits 1,000,000 microseconds (1 second) and calls itself.
Thanks to nimi and Mauris!
[Answer]
# Batch - 34 ~~40~~ bytes
I love built-in variables:
```
:A                    //Set label A
echo %time%           //Print the time in 24 hour format
timeout 1    //Wait 1 second (thanks DavidPostill)
goto A                //Jump back to A and repeat
```
There definitely needs to be some `sleep` command in Batch anytime soon.
[Answer]
## Python 3, 99 Bytes
Apologies if it formats the code weird, doing this from an ipad. (dont ask). I know this code is big considering some of the other answers, but I didn't see a python one yet so I wanted to add it in.
```
import time
import datetime
while(True):
 print(datetime.datetime.now().time())
 time.sleep(1)  
```
[Answer]
# Java, ~~300~~ ~~166~~ ~~137~~ ~~125~~ 124 bytes
~~Nearly~~ More than halved thanks to VoteToClose, Pa√ºlo Ebermann and janschweizer!
```
interface A{static void main(String[]a)throws Exception{for(;;Thread.sleep(1000))System.out.println(new java.util.Date());}}
```
Ungolfed:
```
interface A {
    static void main(String[] a) throws Exception {
        for (;; Thread.sleep(1000)) System.out.println(new java.util.Date());
    }
}
```
[Answer]
## Perl, 99 81 75 51 40 36 29 27 bytes
```
sleep(print gmtime.$/);do$0
```
]