ArduPilot / ArduPilot/MAVProxy

Wrong magic number for 2019/01/01

Open
#1,282 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
595
Forks
773
Avg merge
2d 6h
Merged PRs (30d)
18

Description

Hi there
I just stumbled across this [line of code](https://github.com/ArduPilot/MAVProxy/blob/bade28014144a755ba33be0f3968c617185a37a4/MAVProxy/modules/mavproxy_OpenDroneID.py#L168C34-L168C34) and was wondering if it shouldn't be

```python
from datetime import datetime
from datetime import timezone

jan_1_2019_s = datetime(year=2019, month=1, day=1, tzinfo=timezone.utc).timestamp()
```

Because the referenced magic number 1546261200 is Mon Dec 31 2018 13:00:00 GMT+0000 in UTC. I also think the provided example is more readable. Maybe someone could consider to update this? If I find time I will provide a PR.

Contributor guide

No contributing guide indexed for this repository

Research direction

Open MAVProxy/modules/mavproxy_OpenDroneID.py at line 168 and inspect how the 2019-01-01 timestamp is defined and used. Replace the incorrect magic number with the UTC datetime-based value shown in the issue, then verify that the resulting timestamp is correct and the module remains valid Python.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.