1
\$\begingroup\$

I am currently working as a design engineer intern. I am using an RTC 5 Click as part of my design to provide real solar time. It is nice that MPLAB X is able to generate sample code, but I have no idea how to set the time. This screenshot below is how the sample code sets the time. I can see that the setTime variable is set to 1503870020, but what year, month, day, hour, minute, and second does that translate into?

The code snippet that shows one application

The application calls the following function below.

enter image description here

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Please post your code not as an image.Use the code Tag {} \$\endgroup\$
    – Mike
    Commented Jun 24, 2021 at 9:11

1 Answer 1

1
\$\begingroup\$

Usually in RTC, the time is counted from the Unix Time that is 1 January 1970.

Here is a handy converter.

1503870020 gives you Sunday, August 27, 2017 9:40:20 PM GMT.

A majority of systems relies on that for time tracking.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ @Tony you welcome. If this answer helped you, you can mark it as answered. \$\endgroup\$
    – Damien
    Commented Jun 25, 2021 at 3:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.