[Question]
  [
Write a program or function with no input that prints or returns this string of [24-hour](https://en.wikipedia.org/wiki/24-hour_clock) and [12-hour](https://en.wikipedia.org/wiki/12-hour_clock) times:
```
00:00 12:00am
01:00  1:00am
02:00  2:00am
03:00  3:00am
04:00  4:00am
05:00  5:00am
06:00  6:00am
07:00  7:00am
08:00  8:00am
09:00  9:00am
10:00 10:00am
11:00 11:00am
12:00 12:00pm
13:00  1:00pm
14:00  2:00pm
15:00  3:00pm
16:00  4:00pm
17:00  5:00pm
18:00  6:00pm
19:00  7:00pm
20:00  8:00pm
21:00  9:00pm
22:00 10:00pm
23:00 11:00pm
```
**The string must be output *exactly* as it appears here.** The only exception is that it may optionally have a single trailing newline.
So the [MD5 hash](http://www.miraclesalad.com/webtools/md5.php) of your output should be
```
827ae6e2dbb1df494930baedb3ee2653
```
if you do not have a trailing newline and
```
cd4c3d18abee9bafb495f390a919a13f
```
if you do. (Your hash could be different if your system uses another type of [newline](https://en.wikipedia.org/wiki/Newline#Representations) but that's OK.)
**The shortest code in bytes wins. Tiebreaker is earlier answer.**
  
[Answer]
# Bash + coreutils, 43 30
* Saved 7 bytes thanks to @Yossarian
* Saved 3 bytes thanks to @AndersKaseorg
```
seq 0 23|date -f- +%R\ %l:00%P
```
* `seq` generates integers 0-23, one per line.
* `date` interprets each line as a datetime. Bare integers appear to be sufficient to be recognised as hours of the day by `date`. `date` then outputs each time with the required formatting using the available [time format specifiers](https://www.gnu.org/software/coreutils/manual/html_node/Time-conversion-specifiers.html#Time-conversion-specifiers).
Assumes `LANG=C` locale, as per [this meta answer](http://meta.codegolf.stackexchange.com/a/276/11259).
[Ideone.](https://ideone.com/AY5OKU)
[Answer]
# Python 2, 66 bytes
```
for i in range(24):print'%02d:00%3d:00%sm'%(i,12+i%-12,'ap'[i>11])
```
[Answer]
# C, 73 bytes
```
m(i){for(i=25;--i;)printf("%02d:00%3d:00%cm\n",24-i,12-i%12,"pa"[i/13]);}
```
[mIllIbyte](https://codegolf.stackexchange.com/users/52554/millibyte) found a particularly neat way to rewrite this answer. Thanks!
[Answer]
# MATL, ~~46~~ ~~42~~ 34 bytes
```
12tEt:qy/t15XObZ"!b16XOhhkw14:X~Z)
```
Previously, 42 bytes, `12tEt:q2M/736330+t15XObZ"!b16XOhhkw14:X~Z)`, and 46 bytes, `736330 24t:qw/+t15XO' '24TX"b16XOhhk14: 12X~Z)`. Of course the 736330 wasn't needed, that was crazy!
Note: Doesn't work with TryItOnline, I think there is a compatibility issue between Matlab and Octaves implementation of `datestr`.
`datestr` takes the number representation of a date and converts it to the string representation of that date. The time of the day is the fractional part of the number, so 0.0 corrsponds to January 0, 0000, at time 00:00:00, and 1.0 corresponds to January 1, 0000, at 00:00:00. 1/24 is 1am, 2/24 2am etc.
Explanation
```
12t         % push a 12 onto the stack and duplicate
Et          % double the 12 and duplicate the 24 (stack now has 12, 24, 24, bottom to top)
:q          % make vector 1:24 and decrement by 1, stack has 12, 24, 0:23
y           % duplicate second element on stack (24)
/           % divide, for (0:23)/24
t           % duplicate elements
15XO        % string representation of date, 15 specifies format
b           % bubble up element in stack (gets a 24 on top of the stack)
Z"!         % makes a column of 24 spaces, to put between columns of times
b           % bubble up another (0:23)/24 
16XO        % string representation of date, 16 for a different format
hh          % concatenate two time vectors and the column of spaces
k           % convert string to lowercase, because CO gives AM/PM not am/pm
w           % swap elements in stack, that first 12 is now on top
14:         % vector of equally spaced values 1:14
X~          % set exclusive-or, returns [1 2 3 4 5 6 7 8 9 10 11 13 14]
Z)          % get the right columns of the string array to remove extra column of blanks
            % implicit display
```
To show it works in Matlab, here is a screenshot
[![enter image description here](https://i.stack.imgur.com/21Wnl.png)](https://i.stack.imgur.com/21Wnl.png)
[Answer]
# [///](https://esolangs.org/wiki////), 160 bytes
```
/Z/:00 //S/Z //A/:00am
//P/:00pm
/00Z12A01S1A02S2A03S3A04S4A05S5A06S6A07S7A08S8A09S9A10Z10A11Z11A12Z12P13S1P14S2P15S3P16S4P17S5P18S6P19S7P20S8P21S9P22Z10P23Z11P
```
[Try it online!](//slashes.tryitonline.net#code=L1ovOjAwIC8vUy9aIC8vQS86MDBhbQovL1AvOjAwcG0KLzAwWjEyQTAxUzFBMDJTMkEwM1MzQTA0UzRBMDVTNUEwNlM2QTA3UzdBMDhTOEEwOVM5QTEwWjEwQTExWjExQTEyWjEyUDEzUzFQMTRTMlAxNVMzUDE2UzRQMTdTNVAxOFM2UDE5UzdQMjBTOFAyMVM5UDIyWjEwUDIzWjExUA)
**Ungolfed**
```
00:00 12:00am
01:00  1:00am
02:00  2:00am
03:00  3:00am
04:00  4:00am
05:00  5:00am
06:00  6:00am
07:00  7:00am
08:00  8:00am
09:00  9:00am
10:00 10:00am
11:00 11:00am
12:00 12:00pm
13:00  1:00pm
14:00  2:00pm
15:00  3:00pm
16:00  4:00pm
17:00  5:00pm
18:00  6:00pm
19:00  7:00pm
20:00  8:00pm
21:00  9:00pm
22:00 10:00pm
23:00 11:00pm
```
[Answer]
# MarioLANG, ~~965~~ 834 bytes
[**Try it online**](http://mariolang.tryitonline.net/#code=Kys8PikgKysrQCsrKys-ICAgWyEpID4pPigoKCg6OiguKTo6KCguKSkrOis6LS0oLik6OikpLikuKS4pKysrKysrKysrCisrIiIrICsiPT09PT0iIj09PT0jKSAiKyI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorKyspKyArPj4rKysrKy0gPCs8KS0-KysrICFbLSkuKS4pLikpKDo6KSkuKDooOikpKS4uKCgoOjopKS4oOisoOigoKCg8Cis-KysrICsrIj09PT08KCAiKSIpLSIhKysrIz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSIKKygrKys-KyshKyspPCsoICsrKystKysrKys-CiAtKSkrKT0oIz09PSIrKCArKysrKSsrKysrIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSEKIFshISstWyEoKysrISEhICErITwrISsrIT4oKCgoKCs6KC4pKTo6KCgoLgo9PSMjPT09Iz09PT0jIyM9Iz0jIj0jIz0jIj09PT09PT09PT09PT09PT09PAorKysrKSkpKysrKysrKysrKysrKysrKCgoIVstKS4pLikuKTo6KSkuKDopKSAgID4KPj09PT09PT09PT09PT09PT09PT09PT09PSM9PT09PT09PT09PT09PT09PT0gICAiCis-KyA-CisiKyAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09WyAgID09PT09PT09PT09PT09PT09PT09PSM9PT09PT09PT09PT09PT1bCishPiAhIC0pLikuKS4pKSg6OikpLikpOisoLi4oKCg6OikpLig6KygoKCgoPCsrIS0pLikuKS4pKSg6OikpLikpOisoLigoKDo6KSkuKDorKCgoKCg8Cj0jPT0jPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ij09Iz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09&input=)
well this was ridiculously complicated.
Technically the output is valid but in practice the Tio for MarioLANG output "n " instead of "n" when we print a number with ':'
if I find the time i'll guess i'll try to do a (probably much longer) version of the program that output correctly on Tio 
```
++<>) +++@++++>   [!) >)>((((::(.)::((.))+:+:--(.)::)).).).)+++++++++
++""+ +"=====""====#) "+"============================================
+++)+ +>>+++++- <+<)->+++ ![-).).).))(::)).(:(:)))..(((::)).(:+(:((((<
+>+++ ++"====<( ")")-"!+++#=========================================="
+(+++>++!++)<+( ++++-+++++>
 -))+)=(#==="+( ++++)+++++"==========================================!
 [!!+-[!(+++!!! !+!<+!++!>(((((+:(.))::(((.
==##===#====###=#=#"=##=#"=================<
++++)))+++++++++++++++(((![-).).).)::)).(:))   >
>========================#==================   "
+>+ >
+"+ "=======================================[   =====================#===============[
+!> ! -).).).))(::)).)):+(..(((::)).(:+(((((<++!-).).).))(::)).)):+(.(((::)).(:+(((((<
=#==#======================================="==#======================================
```
**Explanation :**
our main problem here is the fact that we have 6 NaN char (newLine, Space, :, a, p, m)
in marioLANG, in order to print character, we need their ascii value:
* **newLine** is 10
* **Space** is 32
* **:** is 58
* **a** is 97
* **p** is 112
* **m** is 109
So the first thing to do is to set the memory :
```
++<>) +++@++++>   [!) >)> !
++""+ +"=====""====#) "+"==
+++)+ +>>+++++- <+<)->+++ 
+>+++ ++"====<( ")")-"!+++
+(+++>++!++)<+( ++++-+++++
 -))+)=(#==="+( ++++)+++++
 [!!+-[!(+++!!! !+!<+!++!>
==##===#====###=#=#"=##=#"
```
with this, the memory look like : 
```
                   v   
  32 58 0 0 97 109 10 0
  _  :      a   m  \n
```
we will transform **a** into **p** during the rest of the program
then we do the actual output :
```
++<>) +++@++++>   [!) >)>((((::(.)::((.))+:+:--(.)::)).).).)+++++++++
++""+ +"=====""====#) "+"============================================
+++)+ +>>+++++- <+<)->+++ ![-).).).))(::)).(:(:)))..(((::)).(:+(:((((<
+>+++ ++"====<( ")")-"!+++#=========================================="
+(+++>++!++)<+( ++++-+++++>
 -))+)=(#==="+( ++++)+++++"==========================================!
 [!!+-[!(+++!!! !+!<+!++!>(((((+:(.))::(((.
==##===#====###=#=#"=##=#"=================<
++++)))+++++++++++++++(((![-).).).)::)).(:))   >
>========================#==================   "
+>+ >
+"+ "=======================================[   =====================#===============[
+!> ! -).).).))(::)).)):+(..(((::)).(:+(((((<++!-).).).))(::)).)):+(.(((::)).(:+(((((<
=#==#======================================="==#======================================
```
[Answer]
# Julia, ~~88~~ ~~71~~ ~~66~~ 64 bytes
```
[@printf "%02d:00%3d:00%cm
" i-11 i%12+1 i>22?112:97for i=11:34]
```
This is a full program that prints the string with a single trailing newline.
[Try it online!](http://julia.tryitonline.net/#code=W0BwcmludGYgIiUwMmQ6MDAlM2Q6MDAlY20KIiBpLTExIGklMTIrMSBpPjIyPzExMjo5N2ZvciBpPTExOjM0XQ&input=)
Saved 5 bytes thanks to Sp3000 and 2 thanks to Dennis!
[Answer]
## C# function, 100 bytes
```
void F(){for(int i=0;i<24;i++){Console.Write($"{i:00}:00 {(i+11)%12+1,2}:00 {(i>11?"p":"a")}m\n");}}
```
**Ungolfed version:**
```
void F()
{
    for (int i = 0; i < 24; i++)
    {
        Console.Write($"{i:00}:00 {(i + 11)%12 + 1,2}:00 {(i > 11 ? "p" : "a")}m\n");
    }
}
```
`Console.Write()` takes too many characters!
[Answer]
## JavaScript (ES2015), ~~147~~ ~~138~~ ~~137~~ ~~134~~ 133 bytes
```
((o,x,r)=>{for(i=0;i<24;)b=i%12,c=b||12,o+='0'[r](i<10)+i+++x+' '[r]((c<10)+1)+c+x+(i<13?'a':'p')+"m\n";return o})('',':00','repeat')
```
In this version I took advantage of String.repeat() method to get rid of lengthy .slice() and .join() and moved incrementation inside loop. 
Previous version:
```
((o,x,i)=>{for(;i<24;i++){b=i%12;o+=[`0${i+x}`.slice(-5),(b||12)+x+(i<12?'a':'p')+'m'].join(' '.repeat((b>0&&b<10)+1))+"\n"}return o})('',':00',0)
```
Gives output with trailing newline. Tested in Firefox Scratchpad. Not sure if passing arguments to IIFE is OK with "no input" rule.
It's my first submission, so hello to everyone! :)
[Answer]
# TSQL(SQLServer 2012) ~~146~~ ~~124~~ 121
```
DECLARE @ DATETIME=0WHILE @<1BEGIN PRINT
CONVERT(char(5),@,108)+' '+LOWER(RIGHT(FORMAT(@,'g'),8))SET @=dateadd(hh,1,@)END
```
[Try it online!](https://data.stackexchange.com/stackoverflow/query/499873/24-and-12-hour-times)
First attempt, a bit longer, but a one-liner:
```
SELECT CONVERT(char(5),n,108)+' '+LOWER(RIGHT(FORMAT(n,'g'),8))FROM(SELECT
top 24 dateadd(hh,Number,0)n FROM master..spt_values WHERE'P'=type)x
```
[Try it online!](https://data.stackexchange.com/stackoverflow/query/492778/24-and-12-hour-times)
[Answer]
# Perl 5, 58
```
map{printf"%02u:00%3u:00%sm
",$_,$_%12||12,$_>11?p:a}0..23
```
[Answer]
# Javascript, 122 Bytes, 120 Bytes
```
f=j=>j>12?j-12:j;for(i=0;i<24;i++)console.log('%s:00 %s:00%s',i<10?'0'+i:i,i==0?12:f(i)<10?' '+f(i):f(i),i>11?'pm':'am')
```
Edit: Small bug fixed + output:
```
00:00 12:00am
01:00  1:00am
02:00  2:00am
03:00  3:00am
04:00  4:00am
05:00  5:00am
06:00  6:00am
07:00  7:00am
08:00  8:00am
09:00  9:00am
10:00 10:00am
11:00 11:00am
12:00 12:00pm
13:00  1:00pm
14:00  2:00pm
15:00  3:00pm
16:00  4:00pm
17:00  5:00pm
18:00  6:00pm
19:00  7:00pm
20:00  8:00pm
21:00  9:00pm
22:00 10:00pm
23:00 11:00pm
```
[Answer]
# [V](https://github.com/DJMcMayhem/V), ~~56~~ 53 bytes
```
i00:00 23ñYpñH12G$yP13G$pgvó $/am
í/pm
í 0/  
í/12
```
[Try it online!](http://v.tryitonline.net/#code=aTAwOjAwIBsyM8OxWXABw7FIFjEyRyR5UDEzRyRwZ3bDsyAkL2FtCsOtL3BtCsOtIDAvICAKw60vMTI&input=)
Since this can be hard to enter, here is a reversible hexdump:
```
00000000: 6930 303a 3030 201b 3233 f159 7001 f148  i00:00 .23.Yp..H
00000010: 1631 3247 2479 5031 3347 2470 6776 f320  .12G$yP13G$pgv. 
00000020: 242f 616d 0aed 2f70 6d0a ed20 302f 2020  $/am../pm.. 0/  
00000030: 0aed 2f31 320a                           ../12.
```
A [noncompeting version](http://v.tryitonline.net/#code=aTAwOjAwIBsyM8OxWXABw7FIFjEyTHlQMTNMcGd2w7MgJC9hbQrDrS9wbQrDrSAwLyAgCsOtLzEy&input=) is trivially 2 bytes shorter if you replace both occurrences of `G$` with `L`, which was supposed to be the same but had a bug.
Explanation:
```
i00:00<esc>                                     #Enter the starting text.
           23ñYp<C-a>ñ                          #Duplicate and increment 23 times
                      H                         #Move back to the beginning
                       <C-v>12G$y               #Select 12 lines horizontally
                                 P              #Horizontally paste
                                  13G$p         #Move to line 13 and Horizontally paste again
                                       gv       #Reselect the top 12 lines
                                         ó $/am #Replace a space at the end of the line with 'am'
```
---
```
í/pm      #Replace the previous search with 'pm'
í 0/      #Replace "Space+0" with 2 spaces
í/12      #Replace the previous search with "12"
```
[Answer]
## [05AB1E](https://github.com/Adriandmen/05AB1E), ~~51~~ ~~50~~ ~~48~~ ~~44~~ 42 bytes
Saved two bytes thanks to *carusocomputing*
**Code:**
```
24FNgi0}N…:00©ðN12(%12+Dgiðs}®„paN12‹è'mJ,
```
[Try it online!](https://tio.run/nexus/05ab1e#@29k4uaXnmlQ6/eoYZmVgcGhlYc3@BkaaagaGmm7pGce3lBce2jdo4Z5BYlA0UcNOw@vUM/10vn/HwA "05AB1E – TIO Nexus")
**Explanation**
```
24F                                         # for N in [0...23]
   Ngi0}                                    # if len(N)=1, push 0
        N                                   # push N
         …:00©                              # push ":00" and store a copy in register
             ð                              # push " "
              N12(%12+D                     # push 2 copies of N%(-12)+12
                       giðs}                # if the length of that number is 1, 
                                            # push " " and swap with the number
                            ®               # push ":00" again
                             „pa            # push "pa"
                                N12‹è       # index into that with N<12
                                     'm     # push "m"
                                       J,   # join everything and print with newline
```
[Answer]
## PowerShell v2+, 76 bytes
```
0..23|%{"{0:D2}:00{1,3}:00"-f$_,(($_%12),12)[!($_%12)]+('am','pm')[$_-ge12]}
```
Loops from `0..23` and each loop sets a string with the `-f` operator. The first `{0:D2}` ensures we have prepended zeros, the second `{1,3}` ensures we have padded spaces for the middle column. The `{0}` one corresponds to the `$_` of the `-f` operator, while the `{1}` corresponds to the pseudo-ternary that chooses between `$_%12` or `12` based on whether `$_%12` is non-zero or not (i.e., if we're at `$_=13`, this will choose `1` for 1:00pm). We then concatenate that with another pseudo-ternary that chooses the appropriate `am`/`pm`.
---
As opposed to my answer on [List all times in the day at a half hour rate](https://codegolf.stackexchange.com/a/63176/42963), it's actually shorter *here* to brute-force the numbers since we get significantly cheaper padding. Here's the answer using date functions, at **78 bytes**
```
0..23|%{(Date -h $_ -f 'HH:00')+(Date -h $_ -f "h:00tt").ToLower().PadLeft(8)}
```
[Answer]
# C++, ~~81~~ 79 bytes
```
[]{for(time_t t=0,y;t<24;cout<<put_time(gmtime(&y),"%R %l:00%P\n"))y=t++*3600;}
```
This code requires `using namespace std` somewhere preceding it.
It does a loop on the values 0...23. It multiplies each value by 3600, converts to a `tm` struct and prints it. The print format `%R` outputs the 24-hour and minute; the print formats `%l` and `%P` output the proper 12-hour parts; they require [GNU](http://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html).
A working online version is [here](https://ideone.com/xq5x2B).
[Answer]
# Ruby, 66 62 bytes
```
0.upto(23){|i| puts "%02d:00%3d:00#{'ap'[i/12]}m"%[i,(i-1)%12+1]}
```
New version
```
24.times{|i|puts"%02d:00%3d:00#{'ap'[i/12]}m"%[i,(i-1)%12+1]}
```
[Answer]
# JavaScript (ES6), ~~119~~ 116 bytes
```
_=>Array(24).fill().map((_,i)=>`${`0${i}`.slice(-2)}:00 ${` ${(i+11)%12+1}`.slice(-2)}:00${'ap'[+(i>11)]}m`).join`
`
```
[Answer]
# Sclipting, 76 bytes
The program assumes that the input is empty (or `'0'` or anything that converts to the integer `0`).
The byte count assumes UTF-16 encoding.
```
군上❶겠小꼀虛嗎❷꾣갰글❷결加곀剩增❶겠小글虛嗎댆밁⓷꾣갰⓷⓼곀小掘닐밊終
```
Ungolfed:
```
군 // 23
上 // for loop (goes from 0 to 23 if input is 0)
    ❶겠小꼀虛嗎 // n < 10 ? "0" : ""
    ❷          // n
    꾣갰글      // ":00 "
    ❷결加곀剩增 // k = (n+11) % 12 + 1
    ❶겠小글虛嗎 // k < 10 ? " " : ""
    댆밁       // "pa"
    ⓷         // Pull n to top of stack
    꾣갰       // ":00"
    ⓷         // Pull "pa" to top of stack
    ⓼         // Pull k to top of stack
    곀小掘     // "pa"[k < 10 ? 1 : 0]
    닐밊       // "m\n"
終 // end of for loop
```
Each iteration of the loop leaves lots of small strings on the stack; at the end they are all automatically concatenated.
[Answer]
# JavaScript, ~~97~~ 95 bytes
This is based off of [starcorder’s answer](https://codegolf.stackexchange.com/a/81007/668). Thanks to [George Reith](https://codegolf.stackexchange.com/users/11182/george-reith) for a 2 byte improvement.
```
for(i=0,k=12;i<24;k=i++%12+1)console.log('%s:00 %s:00%sm',i>9?i:'0'+i,k>9?k:' '+k,i>11?'p':'a')
```
Ungolfed:
```
for (i=0, k=12; i < 24; k = (i++) % 12 + 1)
    console.log('%s:00 %s:00%sm',
        i > 9 ? i : '0' + i,
        k > 9 ? k : ' ' + k,
        i > 11 ? 'p' : 'a')
```
[Answer]
## Batch, 167 bytes
```
@echo off
set h=11
set p=a
for /l %%a in (0,1,23)do call:e %%a
exit/b
:e
set a=0%1
set/ah=h%%12+1
set h= %h%
if %1==12 set p=p
echo %a:~-2:00 %h:~-2%:00%p%m
```
[Answer]
# [Kotlin](https://kotlinlang.org), 95 bytes
It can be improved for sure.
```
fun p(){for(i in 0..23)println("%02d:00 ${(i+11)%12+1}:00${if(i>12)"p" else "a"}m".format(i))}
```
[Answer]
# PHP, ~~110~~ 107 bytes
```
for($h=0;$h<24;){$m=($h+11)%12+1;echo($h<10?0:"")."$h:00 ".($m<10?" ":"")."$m:00".($h++<12?"a":"p")."m\n";}
```
**exploded view**
```
for ($h=0; $h<24; ) {
  $m = ($h+11) % 12 + 1;
  echo ($h < 10 ?  0  : "") . "$h:00 " .
       ($m < 10 ? " " : "") . "$m:00"  . ($h++ < 12 ? "a" : "p") . "m\n";
}
```
Somewhat surprised, tried to turn the `($i < 10 ? $s : "") . "$i:00"` bit into a function, but it wound up *adding* ~25 characters. No go there.
[Answer]
## Swift, 85 bytes
```
for x in 0...23{print(String(format:"%02d:00 %2d:00\(x<12 ?"a":"p")m",x,12+x % -12))}
```
[Answer]
# C Function, 82 bytes
```
m(i){for(;i<24;printf("%02d:00 %2d:00%cm\n",i,i%12==0?12:i%12,i>11?'p':'a'),i++);}
```
**Usage, 94 Byte**
```
m(i){for(;i<24;printf("%02d:00 %2d:00%cm\n",i,i%12==0?12:i%12,i>11?'p':'a'),i++);}main(){m();}
```
**Ungolfed, 337 Bytes**
```
#include <stdio.h>
void m(){
    int i,a;
    char c;
    for(i=0;i<24;i++){
        if (i%12==0){
            a = 12;
        }
        else{
            a = i%12;
        }
        if (i>11){
            c = 'p';
        } else{
            c = 'a';
        }
        printf("%02d:00 %2d:00%cm\n",i,a,c);
    }
}
int main(){
    m();
}
```
it works on Windows:
[![in the warning you can find the whole program ](https://i.stack.imgur.com/y00oQ.png)](https://i.stack.imgur.com/y00oQ.png)
# C Program, 85 bytes
```
main(i){for(;i<24;printf("%02d:00 %2d:00%cm\n",i,i%12==0?12:i%12,i>11?'p':'a'),i++);}
```
[Answer]
# Foo, 163 bytes
Pretty brute-force approach; nothing clever here (I tried in a couple spots but it ended up being shorter not to), just wanted to give Foo a shot. Foo automatically prints anything within quotes. `$c10` prints a line break. `(## ... )` loops until the current cell equals `##`.
```
"00:00 12:00am"$c10+1(10"0"$i":00  "$i":00am"$c10+1)(12$i":00 "$i":00am"$c10+1)"12:00 12:00pm"$c10+1(22$i":00  ">+1$i<":00pm"$c10+1)(24$i":00 ">+1$i<":00pm"$c10+1)
```
Ungolfed a bit:
```
"00:00 12:00am"$c10+1
(10"0"$i":00  "$i":00am"$c10+1)
(12$i":00 "$i":00am"$c10+1)
"12:00 12:00pm"$c10+1
(22$i":00  ">+1$i<":00pm"$c10+1)
(24$i":00 ">+1$i<":00pm"$c10+1)
```
[Try it online](http://foo.tryitonline.net/#code=IjAwOjAwIDEyOjAwYW0iJGMxMAooMTAiMCIkaSI6MDAgICIkaSI6MDBhbSIkYzEwKzEpCigxMiRpIjowMCAiJGkiOjAwYW0iJGMxMCsxKQoiMTI6MDAgMTI6MDBwbSIkYzEwKzEKKDIyJGkiOjAwICAiPisxJGk8IjowMHBtIiRjMTArMSkKKDI0JGkiOjAwICI-KzEkaTwiOjAwcG0iJGMxMCsxKQ&input=)
[Answer]
# Javascript (using external library - Enumerable) (107 bytes)
```
_.Range(0,24).WriteLine(x=>((x<10?"0"+x:x)+":00 "+(((h=((x+11)%12)+1))<10?" "+h:h)+":00"+(x<12?"am":"pm")))
```
Link to library: <https://github.com/mvegh1/Enumerable/>
Code explanation: Create array of integers from 0 to 23, for each write a line according to the predicate. That predicate checks if current val is less than 10, and pads it with 0, else uses the current val as is. Then adds the minutes string to it. Then basically does a little trickery to convert military to am/pm time, and handles padding for am/pm times less than 10.
[![enter image description here](https://i.stack.imgur.com/BPOlz.png)](https://i.stack.imgur.com/BPOlz.png)
[Answer]
# SmileBASIC, 73 bytes
```
FOR H=0TO 23?FORMAT$(%02D:00 %2D:00%Sm",H,(H+11)MOD 12+1,"ap"[H>11])NEXT
```
Someone found a better 24->12 hour formula than my old one, which saves 3 bytes, and 5 bytes in another program
[Answer]
# PHP, ~~67~~ ~~65~~ 64 bytes
This uses IBM-850 encoding.
```
for(;$i<24;)printf(~┌¤═ø┼¤¤┌╠ø┼¤¤┌îÆ§,$i,$i%12?:12,$i++>11?p:a);
```
With the unencoded string (66 bytes):
```
for(;$i<24;)printf("%02d:00%3d:00%sm\n",$i,$i%12?:12,$i++>11?p:a);
```
Run like this:
```
php -n -r 'for(;$i<24;)printf(~┌¤═ø┼¤¤┌╠ø┼¤¤┌îÆ§,$i,$i%12?:12,$i++>11?p:a);'
```
## Tweaks
* Saved 2 bytes by improving sprintf format
* Saved a byte by getting rid of unnecessary space (thx @Titus)
[Answer]
# tcl, 93
```
set i 0;time {puts [format %02d:00%3d:00[expr $i<12?"a":"p"]m $i [expr $i%-12+12]];incr i} 24
```
[demo](http://www.tutorialspoint.com/execute_tcl_online.php?PID=0Bw_CjBb95KQMd09RT0M2SktUM1U)
]