--- title: TinyGsmTime --- # TinyGsmTime (class) **Module:** **[TinyGsmTime](class_tiny_gsm_time.html)** The CRTP parent class for time printing and retrieval functions. `#include ` ## Time functions ### Public Functions | | Name | | -------------- | -------------- | | String | **[getGSMDateTime](#adaaa4aba622ee5d874fcc2abc6109e84)**([TinyGSMDateTimeFormat](../files/_tiny_gsm_time_8tpp.md#a4d77a5e8d7107365e5ca6f8815ac5714) format)
Get the Date Time as a String. | | bool | **[getNetworkTime](#a68d9baf6ba1f006441b3d71e5e058cdb)**(int * year, int * month, int * day, int * hour, int * minute, int * second, float * timezone)
Get the date and time as parts. | | bool | **[getNetworkUTCTime](#ae8e03f2f8c124b8758383ac8c109bc9e)**(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](#a96cf8b52cd88938c4211d17de826376e)**([TinyGSM_EpochStart](../files/_tiny_gsm_time_8tpp.md#a5addcc95a1822928505c18c8b9b9a277) epoch = TinyGSM_EpochStart::UNIX)
Get the Date/Time as an epoch value. | ## Public Functions Documentation ### Time functions #### functiongetGSMDateTime ```cpp 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 #### functiongetNetworkTime ```cpp 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. #### functiongetNetworkUTCTime ```cpp 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. #### functiongetNetworkEpoch ```cpp uint32_t getNetworkEpoch([TinyGSM_EpochStart](../files/_tiny_gsm_time_8tpp.md#a5addcc95a1822928505c18c8b9b9a277) epoch = TinyGSM_EpochStart::UNIX) ``` - **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](https://www.doxygen.nl) and [m.css](https://mcss.mosra.cz/) with templates from [doxybook2](https://github.com/matusnovak/doxybook2) Updated on 2026-09-11