ubus: expose unix timestamp in ubus system call#17
ubus: expose unix timestamp in ubus system call#17fjamarquez wants to merge 1 commit intoopenwrt:masterfrom
Conversation
|
Out of interest: What is the use case behind this? |
|
The main use case is to always get a unix timestamp from the AP, even if the AP is configured in another time zone. In that case, you will get the timestamp relative to the timezone configured and relative to unix time without the need of any manual conversion. For example, if the AP must always send the timestamp to any application in unix, it is easier if the AP gets the time directly in unixtime, than needing to know the local time zone configured in the AP in order to obtain unix timestamp. In case you have many APs configured with different time zones, you need to know the time zone of each one to get the unix of all of them. In addition, the configured timezone is not obtained from this ubus output. I think that it can be useful, but if you think it is out of interest, it is good. |
|
@fjamarquez: What is the status of your PR? |
Is still open, pending of review after my last comment |
Yes, but what if you need to obtain the Unix time of the system without luci interaction? Anyway, if you think this is out of interest, the pr can be closed |
|
Just use |
|
However, I prefer unixtime provided by the system rather than luci. |
|
Please include a full description of the change (like you did in the PR description) also in the commit message, adhering to |
In case the local time is different from UTC, the ubus
call gets the local and the unix timestamp.
root@c82c2b100000:~# ubus call system info
{
"localtime": 1741345176,
"unixtime": 1741341576,
"uptime": 528,
"load": [
.
.
.
}
Signed-off-by: Francisco Jose Alvarez <fjamarquez@gmail.com>
9df1272 to
f55a911
Compare
|
@dangowrt Done |
Expose the unix timestamp in the ubus system call. In case the local time is different from UTC, the ubus call gets the local time and the unix timestamp.