0

Converting output from DS1307 to RFC3339 compliant timestamp
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Converting output from DS1307 to RFC3339 compliant timestamp

by shanDesai on Fri Dec 15, 2017 2:35 pm

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?

shanDesai
 
Posts: 9
Joined: Tue Dec 12, 2017 9:38 am

Re: Converting output from DS1307 to RFC3339 compliant times

by franklin97355 on Sat Dec 16, 2017 11:28 pm

Which RFC3339 format do you need?

franklin97355
 
Posts: 19022
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Converting output from DS1307 to RFC3339 compliant times

by shanDesai on Mon Dec 18, 2017 4:43 am

If I recall correctly timestamps in InfluxDB actually look like the following:

Code: Select all | TOGGLE FULL SIZE
2016-12-01T19:06:50Z


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.

shanDesai
 
Posts: 9
Joined: Tue Dec 12, 2017 9:38 am

Re: Converting output from DS1307 to RFC3339 compliant times

by franklin97355 on Mon Dec 18, 2017 2:35 pm

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.

franklin97355
 
Posts: 19022
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Please be positive and constructive with your questions and comments.