COSA
An Object-Oriented Platform for Arduino Programming
Time.hh File Reference
#include "Cosa/Types.h"
#include "Cosa/BCD.h"
#include "Cosa/IOStream.hh"
Include dependency graph for Time.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  time_t
 

Typedefs

typedef uint32_t clock_t
 

Enumerations

enum  {
  SUNDAY = 1, MONDAY = 2, TUESDAY = 3, WEDNESDAY = 4,
  THURSDAY = 5, FRIDAY = 6, SATURDAY = 7
}
 

Functions

IOStreamoperator<< (IOStream &outs, const time_t &t)
 

Variables

const uint16_t NTP_EPOCH_YEAR = 1900
 
const uint8_t NTP_EPOCH_WEEKDAY = MONDAY
 
const uint16_t POSIX_EPOCH_YEAR = 1970
 
const uint8_t POSIX_EPOCH_WEEKDAY = THURSDAY
 
const uint16_t Y2K_EPOCH_YEAR = 2000
 
const uint8_t Y2K_EPOCH_WEEKDAY = SATURDAY
 
const uint32_t SECONDS_PER_DAY = 86400L
 
const uint16_t SECONDS_PER_HOUR = 3600
 
const uint8_t SECONDS_PER_MINUTE = 60
 
const uint8_t DAYS_PER_WEEK = 7
 

Detailed Description

Version
1.0

License

Copyright (C) 2013-2015, Mikael Patel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

This file is part of the Arduino Che Cosa project.

Definition in file Time.hh.

Typedef Documentation

typedef uint32_t clock_t

Number of seconds elapsed since January 1 of the Epoch Year, 00:00:00 +0000 (UTC).

Definition at line 55 of file Time.hh.

Enumeration Type Documentation

anonymous enum
Enumerator
SUNDAY 
MONDAY 
TUESDAY 
WEDNESDAY 
THURSDAY 
FRIDAY 
SATURDAY 

Definition at line 29 of file Time.hh.

Function Documentation

IOStream& operator<< ( IOStream outs,
const time_t t 
)

Print the date/time to the given stream with the format "YYYY-MM-DD HH:MM:SS".

Parameters
[in]outsoutput stream.
[in]ttime structure.
Returns
iostream.

Definition at line 23 of file Time.cpp.

Variable Documentation

const uint8_t DAYS_PER_WEEK = 7

Definition at line 60 of file Time.hh.

const uint8_t NTP_EPOCH_WEEKDAY = MONDAY

Definition at line 41 of file Time.hh.

const uint16_t NTP_EPOCH_YEAR = 1900

Definition at line 40 of file Time.hh.

const uint8_t POSIX_EPOCH_WEEKDAY = THURSDAY

Definition at line 45 of file Time.hh.

const uint16_t POSIX_EPOCH_YEAR = 1970

Definition at line 44 of file Time.hh.

const uint32_t SECONDS_PER_DAY = 86400L

Definition at line 57 of file Time.hh.

const uint16_t SECONDS_PER_HOUR = 3600

Definition at line 58 of file Time.hh.

const uint8_t SECONDS_PER_MINUTE = 60

Definition at line 59 of file Time.hh.

const uint8_t Y2K_EPOCH_WEEKDAY = SATURDAY

Definition at line 49 of file Time.hh.

const uint16_t Y2K_EPOCH_YEAR = 2000

Definition at line 48 of file Time.hh.