time_t utcCalc = NTPstamp - 2208988800UL ; Serial.print( day(utcCalc )) ;Serial.print( hour(utcCalc )) ;Serial.print( minute(utcCalc ) );. . .. . .
time_t utcCalc = NTPstamp - 2208988800UL ;Serial.print( day(utcCalc )) ;Serial.print( monthutcCalc )) ;Serial.print( year(utcCalc ) );
Are you still having a problem ?Time and Date are extracted in exactly the same manner.Here is a full date:Code: [Select]time_t utcCalc = NTPstamp - 2208988800UL ;Serial.print( day(utcCalc )) ;Serial.print( monthutcCalc )) ;Serial.print( year(utcCalc ) );Ohh screw it - I tried extracting the specific code from the Time library that does the breakdown down of the time stamp and calculates the date (as opposed to the time) but it was like pulling a weed. There was always some extra bit of code that I needed to extract from the library to make it compile in my project.In the end I just gave up and included the Time library and just used the existing functions - it does not appear to be a big library anyway.Calculation of day of month, month and year seems to be similar to what I was trying to do. But I have not gotten to grips with how it handles the fact that a year is 365.25 days with ending up with rounding errors that results in the day of month being sometimes one too less or one too many.If you want an assessment of the code you have written, post it and maybe someone here can suggest an improvement.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16