I'm currently looking for an excel/CSV sheet which includes all the days of 2013 or 2014 in a column.
This so I can register my working hours, I was thinking to create the CSV using PHP, but maybe there's an other method to achieve this.
Open Excel, Format column A as a Date column. Then type in the first cell desired start date, in the cell underneath type the date after. Then select both cells and extend down till the desired range.
if you're looking to use PHP you can run a loop like the following. Then just copy and paste the output to an excel file.
<?php
date_default_timezone_set('America/New_York');
echo '<table>';
for($x=mktime(0,0,0,1,1,2013); $x<=mktime(0,0,0,12,31,2014);$x+=86400){
echo '<tr><td>'.date("m/d/Y",$x).'</td></tr>';
}
echo '</table>';
or strtotime()
if you wish:
for($x=strtotime('January 1,2013'); $x<=strtotime('December 31,2014'); $x+=86400){
// output
}
Another way:
$year = "2013";
$date = strtotime("$year-01-01");
while(date('Y', $date) == $year) {
$data[] = date('Y-m-d', $date);
$date = strtotime('+1 day', $date);
}
file_put_contents('text.csv', implode("
", $data));