Skip to content

Commit fb859f4

Browse files
committed
getCellularTime: add flag to handle local/utc time
1 parent 5a102bc commit fb859f4

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
@@ -152,9 +152,9 @@ Time ArduinoCellular::getGPSTime(){
152152
return Time(year, month, day, hour, minute, second);
153153
}
154154

155-
Time ArduinoCellular::getCellularTime(){
155+
Time ArduinoCellular::getCellularTime(bool localTime){
156156
// Get the current time from the network as localtime
157-
return getTimeStruct(true);
157+
return getTimeStruct(localTime);
158158
}
159159

160160
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)