-
Notifications
You must be signed in to change notification settings - Fork 793
class_tiny_gsm_time
Sara Damiano edited this page Sep 11, 2026
·
2 revisions
Module: TinyGsmTime
The CRTP parent class for time printing and retrieval functions.
#include <src/TinyGsmTime.tpp>
| Name | |
|---|---|
| String |
getGSMDateTime(TinyGSMDateTimeFormat format) Get the Date Time as a String. |
| bool |
getNetworkTime(int * year, int * month, int * day, int * hour, int * minute, int * second, float * timezone) Get the date and time as parts. |
| bool |
getNetworkUTCTime(int * year, int * month, int * day, int * hour, int * minute, int * second, float * timezone) Get the date and time as parts in UTC. |
| uint32_t |
getNetworkEpoch(TinyGSM_EpochStart epoch = TinyGSM_EpochStart::UNIX) Get the Date/Time as an epoch value. |
String getGSMDateTime([TinyGSMDateTimeFormat](../files/_tiny_gsm_time_8tpp.md#a4d77a5e8d7107365e5ca6f8815ac5714) format)
-
Parameters:
- format The date or time part to get: TinyGSMDateTimeFormat::DATE_FULL, TinyGSMDateTimeFormat::DATE_TIME, or TinyGSMDateTimeFormat::DATE_DATE
- Return: The date and/or time from the module
bool getNetworkTime(int * year, int * month, int * day, int * hour, int * minute, int * second, float * timezone)
-
Parameters:
- year Reference to an int for the year
- month Reference to an int for the month
- day Reference to an int for the day
- hour Reference to an int for the hour
- minute Reference to an int for the minute
- second Reference to an int for the second
- timezone Reference to a float for the timezone
- Return: True if the references have been filled with valid values from the GSM module, false otherwise.
bool getNetworkUTCTime(int * year, int * month, int * day, int * hour, int * minute, int * second, float * timezone)
-
Parameters:
- year Reference to an int for the year
- month Reference to an int for the month
- day Reference to an int for the day
- hour Reference to an int for the hour
- minute Reference to an int for the minute
- second Reference to an int for the second
- timezone Reference to a float for the timezone
- Return: True if the references have been filled with valid values from the GSM module, false otherwise.
uint32_t getNetworkEpoch([TinyGSM_EpochStart](../files/_tiny_gsm_time_8tpp.md#a5addcc95a1822928505c18c8b9b9a277) epoch = <a href="_tiny_gsm_time_8tpp.html#a5addcc95a1822928505c18c8b9b9a277a15395d0642f86c5992abbca5e56e2b29" class="m-doc">TinyGSM_EpochStart::<wbr />UNIX</a>)
-
Parameters:
- epoch The epoch start to use.
- Return: The offset from the start of the epoch or 0 if the epoch could not be retrieved.
Generated by Doxygen and m.css with templates from doxybook2 Updated on 2026-09-11
If you like TinyGSM library - give it a star, or fork it and contribute!