[Question]
  [
Print the dates of all the Sundays in 2017 in the following format : `dd.mm.yyyy`.  
Expected Output:
```
01.01.2017
08.01.2017
15.01.2017
22.01.2017
29.01.2017
05.02.2017
12.02.2017
19.02.2017
26.02.2017
05.03.2017
12.03.2017
19.03.2017
26.03.2017
02.04.2017
09.04.2017
16.04.2017
23.04.2017
30.04.2017
07.05.2017
14.05.2017
21.05.2017
28.05.2017
04.06.2017
11.06.2017
18.06.2017
25.06.2017
02.07.2017
09.07.2017
16.07.2017
23.07.2017
30.07.2017
06.08.2017
13.08.2017
20.08.2017
27.08.2017
03.09.2017
10.09.2017
17.09.2017
24.09.2017
01.10.2017
08.10.2017
15.10.2017
22.10.2017
29.10.2017
05.11.2017
12.11.2017
19.11.2017
26.11.2017
03.12.2017
10.12.2017
17.12.2017
24.12.2017
31.12.2017
```
  
[Answer]
# [Python 2](https://docs.python.org/2/), 81 bytes
```
x=0
exec"print'%05.2f.2017'%(x%30.99+1.01);x+=7+'0009ANW'.count(chr(x/7+40));"*53
```
[Try it online!](https://tio.run/nexus/python2#@19ha8CVWpGarFRQlJlXoq5qYKpnlKZnZGBorq6qUaFqbKBnaaltqGdgqGldoW1rrq1uYGBg6egXrq6XnF@aV6KRnFGkUaFvrm1ioKlpraRlavz/PwA "Python 2 – TIO Nexus")
No date libraries, computes the dates directly. The main trick is to treat the `dd.mm` as a decimal value. For example, `16.04.2017` (April 16) corresponds to the number `16.04`. The number is printed formatted as `xx.xx` with `.2017` appended.
The day and month are computed arithmetically. Each week adds 7 days done as `x+=7`. Taking `x` modulo `30.99` handles rollover by subtracting `30.99` whenever the day number gets too big. This combines `-31` to reset the days with `+0.01` to increment the month. 
The rollover assumes each month has 31 days. Months with fewer days are adjusted for by nudging `x` upwards on certain week numbers with `+[8,8,8,17,25,38,47].count(x/7)`. These list is of the week numbers ending these short months, with `8` tripled because February is 3 days short of 31. 
This list could is compressed into a string by taking ASCII values plus 40. The shift of `+40` could be avoided by using unprintable chars, and could be accessed shorter as a bytes object in Python 3.
[Answer]
# PHP, 48 bytes
```
while($t<53)echo gmdate("d.m.2017
",605e3*$t++);
```
### PHP, 46 bytes (for non-negative UTC offsets)
```
while($t<53)echo date("d.m.2017
",605e3*$t++);
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~90~~ 79 bytes
-5 bytes with the help of xnor (avoid counting the weeks themselves)  
-1 byte thanks to xnor (add back in e for 605000 as 605e3)
```
from time import*
i=0
exec"print strftime('%d.%m.2017',gmtime(i));i+=605e3;"*53
```
**[Try it online!](https://tio.run/nexus/python2#@59WlJ@rUJKZm6qQmVuQX1SixZVpa8CVWpGarFRQlJlXolBcUpQGktdQV03RU83VMzIwNFfXSc8Fi2VqalpnatuaGZimGlsraZka//8PAA)**
`0` seconds since epoch is 00:00:00 on the 1st of January 1970, which, like 2017 was not a leap year. `605000` seconds is 1 week, 3 minutes, 20 seconds. Adding 52 of these "weeks" does not take us beyond midnight.
[Answer]
# Bash + coreutils, 44 bytes
```
seq -f@%f 0 605e3 32e6|date -uf- +%d.%m.2017
```
may save 2 bytes `-u` if GMT is assumed
* Thanks [Digital Trauma](https://codegolf.stackexchange.com/users/11259/digital-trauma) point out `-f` paramter for `date` which saves 10 bytes;
* And use 2017 in format string saves more bytes which idea is from [the answer](https://codegolf.stackexchange.com/a/116324/44718) given by [user63956](https://codegolf.stackexchange.com/users/63956/user63956)
---
* `@0` is 1970-1-1
* `605000` is one week (`604800`) plus 200 sec
	+ 200 sec. should just work since there are only 52 weeks in a year
* `@32000000` is just a little more than a year
[Answer]
# PowerShell, ~~51~~ 47
```
0..52|%{date((date 2017-1-1)+7.*$_)-u %d.%m.%Y}
```
Fairly straightforward. 2017-01-01 is a Sunday, so is every following seven days. We can save two bytes if we only need the script to be working in my lifetime:
```
0..52|%{date((date 17-1-1)+7.*$_)-u %d.%m.%Y}
```
[Answer]
Excel VBA ~~106~~ ~~91~~ ~~79 bytes~~
```
Sub p()
For i = #1/1/2017# To #12/31/2017#
If Weekday(i) = 1 Then MsgBox i
Next
End Sub
```
saved 15 bytes thanks to @Radhato
Assuming 1/1/2017 is Sunday it will save 12 more bytes.
```
Sub p()
For i = #1/1/2017# To #12/31/2017#
MsgBox i
i = i + 6
Next
End Sub
```
Thanks @Toothbrush **66 bytes**
```
Sub p:For i=#1/1/2017# To #12/31/2017#:MsgBox i:i=i+6:Next:End Sub
```
Edit: (Sub and End Sub is not necessary) **52 bytes**
```
For i=#1/1/2017# To #12/31/2017#:MsgBox i:i=i+6:Next
```
[Answer]
# PHP, 67 bytes
Using the fact the PHP automatically assign value 1 to undeclared loop variables, and using Linux epoch times,
```
<?php for(;54>$t+=1;)echo date("d.m.Y\n",604800*($t)+1482624000);?>
```
[Answer]
# k6, 32 bytes
```
`0:("."/|"."\)'$2017.01.01+7*!53
```
Brief explanation:
```
                2017.01.01+7*!53 /add 0, 7, 14, ..., 364 to January 1st
   ("."/|"."\)'$                 /convert to string, turn Y.m.d into d.m.Y
                                 /   split by ".", reverse, join by "."
`0:                              /output to stdout (or stderr), line by line
```
Alas, this seems to only work in the closed-source, on-request-only interpreter.
[![Running the command in the closed-source interpreter.](https://i.stack.imgur.com/Tft4C.png)](https://i.stack.imgur.com/Tft4C.png)
[Answer]
# [Pyke](https://github.com/muddyfish/PYKE), ~~26~~ 24 bytes
```
53 Fy17y"RVs6)c"%d.%m.%Y
```
[Try it online!](https://tio.run/nexus/pyke#@29qrOBWaWheqRQUVmymmaykmqKnmqunGvn/PwA "Pyke – TIO Nexus")
```
53 F                     - for i in range(53):, printing a newline between each
    y17y"                -  Create a time object with the year 2017. (Month and days are initialised to 1.)
         RV  )           -  Repeat i times:
           s6            -   Add 1 week
              c"%d.%m.%Y -  Format in "dd.mm.yyyy" time
```
### Or 11 bytes
If allowed to ignore output format
```
y17y"52VDs6
```
[Try it online!](https://tio.run/nexus/pyke#@19paF6pZGoc5qKkmqKnmqunGqmUzOVdbKbp/f8/AA "Pyke – TIO Nexus")
```
y17y"       - Create a time object with the year 2017. (Month and days are initialised to 1.)
     52V    - Repeat 52 times:
        D   -  Duplicate the old time
         s6 -  Add 1 week
```
[Answer]
## R, ~~79~~ ~~67~~ 58 bytes
```
cat(format(seq(as.Date("2017/01/01"),,7,53),"\n%d.%m.%Y"))
```
First of January being a sunday, this snippet creates a sequence of days, every 7 days starting from the 01-01-2017 to the 31-12-2017, format them to the desired format and print them.
[Answer]
# [Befunge-98 (PyFunge)](https://pythonhosted.org/PyFunge/), ~~99~~ ~~95~~ ~~93~~ 85 bytes, Leaves trailing newline
All the optimizations were made by @JoKing many thanks to them
```
s :1g2/10g\%:d1p10g\`+:b`#@_:1\0d1g#;1+:a/'0+,a%'0+,'.,j;a"7102"4k,d1g7+
>8><><>><><>
```
[Try it online!](https://tio.run/##S0pNK81LT9W1tNAtqAQz//8vVrAyTDfSNzRIj1G1SjEsADEStK2SEpQd4q0MYwxSDNOVrQ21rRL11Q20dRJVQaS6nk6WdaKSuaGBkZJJtg5Qibk2l52FnQ0Qgon//wE "Befunge-98 (PyFunge) – Try It Online")
I felt like we were missing out on some esostericity here so I made a solution in my favourite Esosteric language.
**Explanation**:  
`>8><><>><><>` Encodes the length of the 12 months  
`s`  Store the old day in the blank space  
[Answer]
## JavaScript, ~~111~~ 106 bytes
```
for(i=14833e8;i<1515e9;i+=605e6)console.log(new Date(i).toJSON().replace(/(....).(..).(..).*/,'$3.$2.$1'))
```
Note: Stack Exchange's console isn't long enough to display the entire list, so here's the first half as a separate snippet:
```
for(i=14833e8;i<15e11;i+=605e6)console.log(new Date(i).toJSON().replace(/(....).(..).(..).*/,'$3.$2.$1'))
```
The custom format costs me 40 bytes...
[Answer]
# [Perl 5](https://www.perl.org/), 64 bytes
```
use POSIX;print strftime"%d.%m.%Y\n",0,0,0,7*$_+1,0,117for 0..52
```
[Try it online!](https://tio.run/nexus/perl5#@19anKoQ4B/sGWFdUJSZV6JQXFKUVpKZm6qkmqKnmqunGhmTp6RjAIbmWirx2oZAhqGheVp@kYKBnp6p0f//AA "Perl 5 – TIO Nexus")
The task given was 2017, not any year, so I hardcoded in:
* 117 (which is perlish for year 2017, 1900+117)
* +1 because 1st of January is a sunday in 2017
* 0..52 because 2017 have 53 sundays
POSIX is a core module and is always installed with Perl5. Doing the same without using modules in 101 bytes, removing whitespace:
```
$$_[5]==117&&printf"%02d.%02d.%d\n",$$_[3],$$_[4]+1,$$_[5]+1900
  for map[gmtime(($_*7+3)*86400)],0..1e4
```
[Answer]
# Ruby, 75 bytes
Straightforward solution to figure out the dates with `Time`.
```
t=Time.new 2017
365.times{puts t.strftime("%d.%m.%Y")if t.sunday?
t+=86400}
```
[Answer]
## SAS, ~~52~~ 50 bytes
Saved 2 bytes thanks to @user3490.
```
data;do i=20820to 21184 by 7;put i ddmmyyp10.;end;
```
[Answer]
# Mathematica ~~90~~ 84 bytes
Fairly wordy. numbermaniac and Scott Milner saved 5 and 1 bytes, respectively.
```
Column[#~DateString~{"Day",".","Month",".","Year"}&/@DayRange["2017","2018",Sunday]]
```
[Answer]
# VBA, 81 bytes (maybe 64)
```
Sub p()
For i = 0 To 52
MsgBox format(42736 + i * 7, "dd.mm.yyyy")
Next i
End Sub
```
My first post. Building on newguy's solution by removing the check for weekdays and just specifying every 7th day. Removing the dates saves 12 bytes a piece. 42736 is 1/1/2017.
Output date format depends on system setting. Is that allowed?
If so, it's 64 bytes because you don't need the *format* method.
```
MsgBox #1/1/2017# + i * 7
```
[Answer]
# [AHK](https://autohotkey.com/), 67 bytes
```
d=20170101
Loop,52{
FormatTime,p,%d%,dd.MM.yyyy
Send,%p%`n
d+=7,d
}
```
Nothing magical happens here. I tried to find a shorter means than `FormatTime`
but I failed.
[Answer]
# Java 8+, ~~104~~ ~~100~~ 99 bytes
```
()->{for(int t=0;t<53;)System.out.printf("%1$td.%1$tm.2017%n",new java.util.Date(t++*604800000L));}
```
# Java 5+, ~~109~~ ~~105~~ 104 bytes
```
void f(){for(int t=0;t<53;)System.out.printf("%1$td.%1$tm.2017%n",new java.util.Date(t++*604800000L));}
```
Uses the date-capabilities of the `printf` format.
[Test it yourself!](http://ideone.com/fZxAYV)
## Savings
1. 104 -> 100: changed the loop values and the multiplicand.
2. 100 -> 99: golfed the loop
[Answer]
# T-SQL, 94 Bytes
```
DECLARE @ INT=0,@_ DATETIME='2017'W:SET @+=1SET @_+=7PRINT FORMAT(@_,'dd.MM.yyy')IF @<52GOTO W
```
if you don't like SQL GOTO or WHILE, here is a 122 bytes CTE solution
```
WITH C AS(SELECT CAST('2017'AS DATETIME)x UNION ALL SELECT x+7FROM C WHERE X<'12-31-17')SELECT FORMAT(x,'dd.MM.yyy')FROM C
```
[Answer]
# Ruby, 60+7 = 67 bytes
Uses the `-rdate` flag.
```
(d=Date.new 1).step(d+365,7){|d|puts d.strftime"%d.%m.2017"}
```
[Answer]
# Groovy, ~~81~~ ~~77~~ ~~63~~ ~~60~~ 56 bytes
```
d=new Date(0);53.times{printf('%td.%<tm.2017%n',d);d+=7}
```
The above can be run as groovy script.
My first code golf entry.
Fortunately, the year 1970 was not a leap year, thus can use it as a base.
Thanks to Dennis, here's a:
[Try it online!](https://tio.run/nexus/groovy#@59im5daruCSWJKqYaBpbWqsV5KZm1pcXVCUmVeSpqGuWpKip2pTkqtnZGBorpqnrpOiaZ2ibWte@/8/AA)
[Answer]
# C#, 138 111 102 bytes
*Saved 9 more bytes thanks to [Johan du Toit](https://codegolf.stackexchange.com/users/41374/johan-du-toit)!*
*Saved 27 bytes thanks to [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen)'s suggestions!*
```
()=>{for(int i=0;i<53;)Console.Write(new DateTime(2017,1,1).AddDays(7*i++).ToString("dd.MM.yyyy\n"));}
```
Anonymous function which prints all Sundays in 2017.
Full program with ungolfed method:
```
using System;
class P
{
    static void Main()
    {
        Action f =
        ()=>
        {
            for (int i = 0; i < 53; )
                Console.Write(new DateTime(2017, 1, 1).AddDays(7 * i++).ToString("dd.MM.yyyy\n"));
        };
        
        
        f();
    }
}
```
[Answer]
# C#, ~~110~~ 109 bytes
```
using System;()=>{for(int i=42729;i<43100;Console.Write(DateTime.FromOADate(i+=7).ToString("dd.MM.yyy\n")));}
```
[You can enjoy this program online here](https://dotnetfiddle.net/YVlOls) 
In this soluion we : 
* Use OLE Automation Date (OADate) to avoid "AddDay()" from datetime.  
`FromOADate()` seem big but it's equal to `new DateTime(2017,1,1)`
* Start the loop on the last sunday of 2016. to allow us to increment with operator `+=` only. This operator return the value after the increment is done.
* Increment by 7 days to jump from sunday to sunday before printing the date.
* We stop once the last sunday of 2017 has been hit.
* ~~Use `Debug` instead of `Console` to save two characters~~
* Avoid having explicit variable declaration and assignment
[Answer]
# TSQL, ~~112~~ 105 bytes
```
SELECT CONVERT(VARCHAR,DATEADD(d,number*7,42734),104)FROM master..spt_values WHERE type='p' AND number<53
```
[Demo](http://rextester.com/LSYHK15612)
[T-SQL Convert Syntax](https://technet.microsoft.com/en-us/library/ms187928(v=sql.100).aspx)
[Answer]
# JavaScript (ES6), 123 bytes
It's my first post here, hello!
```
a=x=>`0${x}.`.slice(-3);[].map.call('155274263153',(x,i)=>{for(j=0;j<4+(2633>>i&1);j++)console.log(a(+x+j*7)+a(i+1)+2017)})
```
This solution uses hardcoded data and is designed to work specifically for the year 2017. It relies on no date/time APIs.
As for the digits in the string `155274263153`, each digit is a number of its own and denotes the first Sunday of each consecutive month. Output for the entire year can be generated by successively adding 7 to those.
What about the magic number, `2633`, used in the loop?  
Well... `2633` (decimal) is `101001001001` in binary. Now what could those `1`s mean? Starting from the right, the 1st, 4th, 7th, 10th and 12th bit are set. This corresponds to months which happen to have five Sundays, as opposed to those that have only four. Golfed down to this neat expression, it initially looked like this: `for(j=0;j<4+ +[0,3,6,9,11].includes(i);j++)`.
I guess the remaining parts are fairly self-explanatory.
[Answer]
# T-SQL, ~~79~~ 77 Bytes
After helping Salman A improve [his answer](https://codegolf.stackexchange.com/a/116469/45600). I decided to write my own using a loop and `PRINT`.
I ended with this 90 bytes solution.
```
DECLARE @d DATETIME=42734 WHILE @d<43100BEGIN PRINT CONVERT(VARCHAR,@d,104)SET @d=@d+7 END
```
Then I looked at the current leader in T-SQL which was 94 bytes from WORNG ALL with [this answer](https://codegolf.stackexchange.com/a/116409/45600).
This guy had found very good tricks.
1. Name the variable only `@`
2. Loop with `GOTO` instead of actual LOOP
3. Save one character using `FORMAT` instead of `CONVERT`. (SSMS2012+ only)
Using these tricks, this solution was trimmed down to the solution below which is 79 bytes.
```
DECLARE @ DATETIME=42734G:PRINT FORMAT(@,'dd.MM.yyy')SET @+=7IF @<43100GOTO G
```
[Answer]
# [Octave](https://www.gnu.org/software/octave/), 37 bytes
A lot shorter than all other non-golfing languages, and it's even tied with Jelly! Way to go Octave! :)
```
disp(datestr(367:7:737,'DD.mm.2017'))
```
[Try it online!](https://tio.run/##y08uSSxL/f8/JbO4QCMlsSS1uKRIw9jM3AoIjc111F1c9HJz9YwMDM3VNTX//wcA "Octave – Try It Online")
Luckily, year `2 AD` looks exactly the same as year `2017 AD`. Both starts and ends at a Sunday, and neither is a leap year. This saves a lot of bytes, since `367:7:737` is quite a bit shorter than `736696:7:737060`. 
This converts the number of days since `01.01.0001`, to a string on the format `DD.mm`, with a trailing `.2017`.
[Answer]
# [Haskell](https://www.haskell.org/), ~~133~~ 130 bytes
```
import Data.Time.Calendar
((\[f,g,h,i,j]->i:j:'.':f:g:".2017\n").drop 5.show)=<<take 53(iterate(addDays 7)$fromGregorian 2017 1 1)
```
[Try it online!](https://tio.run/##FczRCoIwFADQ977iIoEbrJGFCEN7SegD6i17uODUqdvkbhF9/aLzAWfCsOh1TcnYzVOEFiPKh7FaXnHVrkfahYax7jmIUUzCiPl1uBg1q1zmalCjyuTpWFSdy7jsyW9QyjD5D2/qOuKioTwzEzVh1Az7vsVvgIrvB/L2Rnr0ZNDBP4ACCp4sGtds73iPBCH9AA)
### Without a calendar library, ~~148~~ ~~144~~ 140 bytes
```
(\l->last l!l++length l!l++"2017\n").fst.span(>0).(<$>scanl((+).(+28))0[3,0,3,2,3,2,3,3,2,3,2]).(-)=<<[1,8..365]
a!_=['0'|a<=9]++show a++"."
```
This is funny since using an operator for the padding function saves two bytes even though the second argument is unused, because less parentheses are needed – `p(last l)` is longer than `last l!l`. Works by calculating `day/month` pairs by subtracting the cumulative month start dates from the day of the year. The month start dates are compressed as (`scanl((+).(+28))0[3,0,3,2,3,2,3,3,2,3,2]`). Month number is the number of positive elements and day number is the last positive element.
[Try it online!](https://tio.run/##LY3LCsIwEEX3fkUsQhOShrRFrdD0J1y2RYbShzjG4kTc@O3Ggl0cOIe7uBPQrUcMZJvAG0wqBPIMtygl9m7009@jzKTHxkVCD@Q1zeB4ZYTm5a6iDhxyLpeSWSGEqXNlVK6yldXaZU@ELcs6VYXW@WHfbmB7sXVs4g@U9tRKSdPjzWB501G4w9Uxy@aXP/sno/DtBoSRQtLN8w8)
[Answer]
## C#, 116 114 113 bytes
`for(long i=(long)636188256e9;i<636502857e9;i+=(long)605e10)Out.Write(‌​new DateTime(i).ToString("dd.MM.yyyy\n"));`
Can be run in the interactive windows of Visual Studio (or any other C# REPL based on Roslyn)
Down to 113 bytes: thanks to Kevin Cruijssen.
]