PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Time
libdatetime
dt_fromEt.c
1
/*
2
dt_fromEt.c
3
4
Copyright (c) Parallax Inc 2015. All rights MIT licensed;
5
see end of file.
6
*/
7
8
#include "
simpletools.h
"
9
#include "
datetime.h
"
10
11
datetime
dt_fromEt
(
int
et)
12
{
13
datetime
dt;
14
int
date = dte_dateETV(et);
15
int
time = dte_timeETV(et);
16
17
dt.y = date >> 16;
18
dt.mo = (date >> 8) & 0xFF;
19
dt.d = date & 0xFF;
20
dt.h = time >> 16;
21
dt.m = (time >> 8) & 0xFF;
22
dt.s = time & 0xFF;
23
24
return
dt;
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,...
dt_fromEt
datetime dt_fromEt(int et)
Get the datetime representation of an a Unix epoch time (number of seconds from Midnight,...
Definition:
dt_fromEt.c:11
datetime.h
This library provides convenient functions for a variety of timekeeping operations....
datetime_st
datetime_st Structure containing y, mo, h, m, and s elements.
Definition:
datetime.h:56
Generated on Fri May 20 2022 16:48:05 for PropWare by
1.8.17