Skip to content

Commit 520415f

Browse files
committed
getCellularTime: add flag to handle local/utc time
1 parent 4fc33a2 commit 520415f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/ArduinoCellular.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ Time ArduinoCellular::getGPSTime(){
153153
return Time(year, month, day, hour, minute, second);
154154
}
155155

156-
Time ArduinoCellular::getCellularTime(){
156+
Time ArduinoCellular::getCellularTime(bool localTime){
157157
// Get the current time from the network as localtime
158-
return getTimeStruct(true);
158+
return getTimeStruct(localTime);
159159
}
160160

161161
bool ArduinoCellular::syncCellularTime(){

src/ArduinoCellular.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ class ArduinoCellular {
161161

162162
/**
163163
* @brief Gets the current time from the network.
164+
* @param localTime If true, the time will be converted to local time. Default is true.
164165
* @return The current time.
165166
*/
166-
Time getCellularTime();
167+
Time getCellularTime(bool localTime = true);
167168

168169
/**
169170
* @brief Sync the modem time using NTP service.

0 commit comments

Comments
 (0)