PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Time
libdatetime
dte_toSPD.c
1
/*
2
dte_toSPD.c
3
4
Ported from Bob Belleville's date_time_epoch.spin from
5
http://obex.parallax.com/object/191
6
7
Copyright (c) Parallax Inc 2015. All rights MIT licensed;
8
see end of file.
9
*/
10
11
#include "
simpletools.h
"
12
#include "
datetime.h
"
13
14
int
dte_toSPD(
int
h,
int
m,
int
s)
15
{
16
// convert hour, minute and second to seconds per day
17
// 0..86399
18
return
h*3600 + m*60 + s;
19
}
20
21
/*
22
TERMS OF USE: MIT License
23
24
Permission is hereby granted, free of charge, to any person obtaining a
25
copy of this software and associated documentation files (the "Software"),
26
to deal in the Software without restriction, including without limitation
27
the rights to use, copy, modify, merge, publish, distribute, sublicense,
28
and/or sell copies of the Software, and to permit persons to whom the
29
Software is furnished to do so, subject to the following conditions:
30
31
The above copyright notice and this permission notice shall be included in
32
all copies or substantial portions of the Software.
33
34
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
37
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
40
DEALINGS IN THE SOFTWARE.
41
*/
42
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
datetime.h
This library provides convenient functions for a variety of timekeeping operations....
Generated on Fri May 20 2022 16:48:05 for PropWare by
1.8.17