Print current date, without complex time commands <p>The prompt is:</p> <p>Implement a function that determines and prints out the current year, month and day. </p> <p>For example:</p> <p>Today is 03/04/2014.</p> <p>You guys dont have to really mind the code i wrote, its just kinda like scribble trying to figure our a way to print the current date using the seconds since the epoch given by the time(NULL) command.</p> <p>Before anyone gives me a super complex time command code etc etc, im pretty sure my professor wants us to convert the unix time (seconds since the epoch: jan 1, 1970) to the current date somehow.</p> <p>Would anyone be able to help me in anyway to do this in the way my professor wants?</p> <p>Thanks!</p> <p>The code i currently have is:</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;time.h&gt; int main () { int days, weeks, months, years, option, rmd, currentyear, currentmonth; time_t seconds; seconds = time(NULL); days = seconds/(60*60*24); weeks = seconds/((60*60*24)*7); rmd=seconds%31557600; months = ((seconds/31557600) * 12)+(((float)rmd/31557600)*12); years = days/(365.25); currentyear = 1970 + years; currentmonth = (((float)rmd/31557600)*12)+1; printf("%ld/%ld", currentmonth,currentyear); ; return 0; } </code></pre>