Snorktracker
 All Data Structures Files Functions Variables Macros Pages
Public Member Functions | Protected Attributes | Friends
MyDate Class Reference

#include <Gps.h>

Public Member Functions

int year ()
 
int month ()
 
int day ()
 
void clear ()
 
String dateString ()
 

Protected Attributes

int date
 Date in the form of YearMonthDay i.e. 20170115.
 

Friends

class MyGps
 

Detailed Description

Class to store the date with an integer.

Definition at line 73 of file Gps.h.

Member Function Documentation

void MyDate::clear ( )

Reset the values.

Definition at line 331 of file Gps.h.

References date.

Referenced by MyGps::clear().

332 {
333  date = 0;
334 }
int date
Date in the form of YearMonthDay i.e. 20170115.
Definition: Gps.h:77
String MyDate::dateString ( )

Returns the gps date as a string

Definition at line 355 of file Gps.h.

References day(), month(), and year().

Referenced by MyGsmGps::getGps(), MyGsmGps::getGpsFromGsm(), and MyWebServer::handleLoadInfoInfo().

356 {
357  return String(day()) + '-' + String(month()) + '-' + String(year());
358 }
int month()
Definition: Gps.h:343
int day()
Definition: Gps.h:349
int year()
Definition: Gps.h:337
int MyDate::day ( )

Gets the day from the date

Definition at line 349 of file Gps.h.

References date.

Referenced by dateString().

350 {
351  return date % 100;
352 }
int date
Date in the form of YearMonthDay i.e. 20170115.
Definition: Gps.h:77
int MyDate::month ( )

Gets the Month from the date

Definition at line 343 of file Gps.h.

References date.

Referenced by dateString().

344 {
345  return (date / 100) % 100;
346 }
int date
Date in the form of YearMonthDay i.e. 20170115.
Definition: Gps.h:77
int MyDate::year ( )

Gets the year from the date

Definition at line 337 of file Gps.h.

References date.

Referenced by dateString().

338 {
339  return date / 10000;
340 }
int date
Date in the form of YearMonthDay i.e. 20170115.
Definition: Gps.h:77

The documentation for this class was generated from the following file: