Adafruit Ultimate GPS Module Year

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
binkerd
 
Posts: 1
Joined: Sun May 26, 2013 9:33 pm

Adafruit Ultimate GPS Module Year

Post by binkerd »

I have an Adafruit Ultimate GPS module and am using the Arduino library to return date information. The function GPS.year returns the 2 digit year but I nead the year and century to calculate DST start and end dates. In the example supplied with the code the full year is printed by prepending a 20 in front of GPS.date. Is there a way to retrieve the century information from the GPS library?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Adafruit Ultimate GPS Module Year

Post by adafruit_support_rick »

The year comes from the GPS as two digits. Looks at the GPRMC sentence - today's date (Nov 4, 2013) shows up as 041113. You'll have to add 2000.

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

Return to “Arduino Shields from Adafruit”