I am using a DS1307 breakout board in conjunction with BNO0555 in order to acquire Measurements from the BNO055 itself and provide timestamps of the data acquired to an Arduino Yun. I would actually like to send the data to a Raspberry Pi which runs InfluxDB which mostly prints timestamps in the RFC3339 format. I do not actually see any library implementation of converting a timestamp to RFC3339 compliant output anywhere.
Can someone provide a way how to overcome this problem?
Converting output from DS1307 to RFC3339 compliant timestamp
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- shanDesai
- Posts: 12
- Joined: Tue Dec 12, 2017 9:38 am
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Converting output from DS1307 to RFC3339 compliant times
Which RFC3339 format do you need?
- shanDesai
- Posts: 12
- Joined: Tue Dec 12, 2017 9:38 am
Re: Converting output from DS1307 to RFC3339 compliant times
If I recall correctly timestamps in InfluxDB actually look like the following:
Which implies 6 minutes and 50 seconds after the 19th hour on 1st of December 2016. This is similar to an example in the RFC3339 itself. I want to stick to the UTC Time as opposed to Offsets of different timezones. Where Z determines the Time Offset to UTC.
Code: Select all
2016-12-01T19:06:50Z
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Converting output from DS1307 to RFC3339 compliant times
The libraries should let you extract the data for year, month, date, hour, minute, second and then you can format that in your code in any format you need.
Please be positive and constructive with your questions and comments.