PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Time
libdatetime
dte_timeETV.c
1
/*
2
dte_timeETV.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_timeETV(
int
etv)
15
{
16
// return the time of a epoch time variable as three bytes
17
// in a long H:M:S
18
int
spd, h, m;
19
spd = etv % 86400;
20
h = spd / 3600;
21
spd -= h*3600;
22
m = spd / 60;
23
spd -= m * 60;
24
return
(h << 16) | (m << 8) | spd;
25
}
26
27
/*
28
TERMS OF USE: MIT License
29
30
Permission is hereby granted, free of charge, to any person obtaining a
31
copy of this software and associated documentation files (the "Software"),
32
to deal in the Software without restriction, including without limitation
33
the rights to use, copy, modify, merge, publish, distribute, sublicense,
34
and/or sell copies of the Software, and to permit persons to whom the
35
Software is furnished to do so, subject to the following conditions:
36
37
The above copyright notice and this permission notice shall be included in
38
all copies or substantial portions of the Software.
39
40
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
42
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
43
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
44
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
45
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
46
DEALINGS IN THE SOFTWARE.
47
*/
48
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