What's new

Where is stored system time?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

nmitev

Occasional Visitor
Hello,

I noticed that system time is se to 1-Aug by default. After hard reset and if there is no internet connection the log file prints 1-Aug as system date.
Where in the source code is this setting located?

Best Regards,
Nikolay Mitev
 
If the router does not see an NTP Service, no time and date will be set on the router. You can set the time and date manually on the router. You can telnet or SSH into the router, with your user credentials, and manually set the date: date -s "2013-09-20 12:00"
 
Hello,

I noticed that system time is se to 1-Aug by default. After hard reset and if there is no internet connection the log file prints 1-Aug as system date.
Where in the source code is this setting located?

Best Regards,
Nikolay Mitev

The time is set by init(rc), see rc's source code, common.c:setup_timezone().

For RT-AC66U, if system time is before RC_BUILDTIME (Aug 1 00:00:00 GMT 2015) then it is set to RC_BUILDTIME.
 
I noticed that system time is se to 1-Aug by default. After hard reset and if there is no internet connection the log file prints 1-Aug as system date.

hard-coded so certain processes can bootstrap - so don't worry so much...
 
hard-coded so certain processes can bootstrap - so don't worry so much...
I am aware that it is hard-coded. But since I am building my own firmware from source code I want to change the default value. This is why I am asking where it is hard-coded :)
 
I am aware that it is hard-coded. But since I am building my own firmware from source code I want to change the default value. This is why I am asking where it is hard-coded :)

Is this the definition.. ?

release/src/router/rc/common.c

Code:
#ifndef RC_BUILDTIME
#define RC_BUILDTIME 1438387200 // Aug 1 00:00:00 GMT 2015
 
Last edited:
Is this the definition.. ?

release/src/router/rc/common.c

Code:
#ifndef RC_BUILDTIME
#define RC_BUILDTIME 1438387200 // Aug 1 00:00:00 GMT 2015

I'm tempted to have BUILDTIME properly set, however I kinda like the idea of having the default time so radically different - makes it easier to spot an NTP issue than if there were just a few days of shift. Having such a fixed, round value makes it easier to spot.
 
I'm tempted to have BUILDTIME properly set, however I kinda like the idea of having the default time so radically different - makes it easier to spot an NTP issue than if there were just a few days of shift. Having such a fixed, round value makes it easier to spot.
Fully agree with you. Just I was asking for myself.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top