Mikroelektronika MIKROE-350 Datenbogen
![Mikroelektronika](https://files.manualsbrain.com/attachments/e0529b3b58069a916ad7bb89f7e9f5f0eda73421/common/fit/150/50/1b07b99aa3112e022a916b06db07f1f4f211e91d41878452d87c7638b1bf/brand_logo.gif)
TIME LIBRARY
The Time Library contains functions and type definitions for time calculations in the UNIX time for-
mat which counts the number of seconds since the "epoch". This is very convenient for programs
that work with time intervals: the difference between two UNIX time values is a real-time differ-
ence measured in seconds.
mat which counts the number of seconds since the "epoch". This is very convenient for programs
that work with time intervals: the difference between two UNIX time values is a real-time differ-
ence measured in seconds.
What is the epoch?
Originally it was defined as the beginning of 1970 GMT. ( January 1, 1970 Julian day ) GMT,
Greenwich Mean Time, is a traditional term for the time zone in England.
Originally it was defined as the beginning of 1970 GMT. ( January 1, 1970 Julian day ) GMT,
Greenwich Mean Time, is a traditional term for the time zone in England.
The TimeStruct type is a structure type suitable for time and date storage.
Library Routines
- Time_dateToEpoch
- Time_epochToDate
- Time_datediff
- Time_epochToDate
- Time_datediff
Time_dateToEpoch
495
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
Prototype
sub function Time_dateToEpoch(dim byref ts as TimeStruct) as
longint
longint
Returns
Number of seconds since January 1, 1970 0h00mn00s.
Description
This function returns the UNIX time : number of seconds since January 1, 1970
0h00mn00s.
0h00mn00s.
Parameters :
-
ts:
time and date value for calculating UNIX time.
Requires
Nothing.
Example
dim ts1 as TimeStruct
Epoch
as longint
...
' what is the epoch of the date in ts ?
epoch = Time_dateToEpoch(ts1)
' what is the epoch of the date in ts ?
epoch = Time_dateToEpoch(ts1)