The title pretty much explains my problem. I´m given the number of seconds that have passed since the 1st of January 1970 and I have to return today´s date in (dd/mm/yyyy) format.
I know how to calculate the current year, so the hard part is calculating the current month and day. As I need to find a way of knowing if a month is 28,30 or 31 days long and find a way of, when a year is complete, passing from month 12 to month 1
I will denote the epoch time $E$. you know that the days passed since 01/01/1970 is going to be: $$d=\left\lfloor \frac{E}{86400} \right\rfloor$$ now for the years: $$y=\left\lfloor\frac{d}{365.25}\right\rfloor$$ now the first leap year in epoch was 1972, so the number of leap years can be represented by: $$L=\left\lfloor\frac{y-2}{4}\right\rfloor$$ from this and the number of years you can work out if the current year is a leap year, making an algorithrm to change the days in february whether it is or not, then just have a search function for the months like: $$1\le d_y<31\implies m=\text{jan}$$ etc.