Converting output from DS1307 to RFC3339 compliant timestamp

For RTC breakouts, etc., use the Other Products from Adafruit forum

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
shanDesai
 
Posts: 12
Joined: Tue Dec 12, 2017 9:38 am

Converting output from DS1307 to RFC3339 compliant timestamp

Post by shanDesai »

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?

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: Converting output from DS1307 to RFC3339 compliant times

Post by Franklin97355 »

Which RFC3339 format do you need?

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

Re: Converting output from DS1307 to RFC3339 compliant times

Post by shanDesai »

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

Code: Select all

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.

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: Converting output from DS1307 to RFC3339 compliant times

Post by Franklin97355 »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Clock Kits (discontinued)”