Skip to content

Commit 66b1a3e

Browse files
committed
Local Time entry + time picker widget
1 parent 1c07e05 commit 66b1a3e

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

content/arduino-cloud/01.getting-started/02.technical-reference/iot-cloud-tech-ref.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,17 @@ This feature allows Arduino devices to communicate with each other by sharing va
131131
Using this feature you can link variables of the same data type between **two or more cloud-enabled devices**, and Arduino IoT Cloud will automatically ensure any change to their value is propagated among all linked boards.
132132
For example, one button could set three smart bulbs to the same color by just setting a variable on one device and reading it on the others. Or you could turn on a heater when temperature sensors in your room or outside in your weather station drop below a certain level.
133133

134+
### Local Time
135+
136+
To retrieve local time, use the `ArduinoCloud.getLocalTime()` function in a sketch. The value returned is the Unix timestamp, which is time passed in seconds since 1970.
137+
138+
This data can be stored in a `CloudTime` variable, and can be visualed using the [Time Picker widget](/arduino-cloud/getting-started/technical-reference#time-picker) in a dashboard.
139+
140+
141+
```arduino
142+
myTimeVariable = ArduinoCloud.getLocalTime()
143+
```
144+
134145
## Things
135146

136147
In order to use your devices in IoT Cloud, you need to associate a Thing to each of them. A Thing is an abstract concept which holds the configuration of the variables and other settings, as well as the history of the data collected for the variables.
@@ -153,7 +164,7 @@ The steps below can be used as guidance when **setting up a Thing**:
153164

154165
## Variables
155166

156-
***Visit the main article on [Cloud Variables](arduino-cloud/getting-started/cloud-variables) for a more detailed coverage.***
167+
***Visit the main article on [Cloud Variables](/arduino-cloud/getting-started/cloud-variables) for a more detailed coverage.***
157168

158169
A thing can have one or more variables. A variable can be used for multiple purposes:
159170

Loading

content/arduino-cloud/01.getting-started/06.dashboard-widgets/dashboard-widgets.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,22 @@ else if(stepperVariable == 11){
126126
Serial.println(stepperVariable);
127127
```
128128

129+
### Time Picker
130+
131+
![Time Picker Widget](assets/time-picker.png)
132+
133+
The time picker widget is used to retrieve the local time on your board.
134+
135+
Can be linked with the **CloudTime** variable.
136+
137+
An example of how it is used in a sketch:
138+
139+
```
140+
CloudTimeVariable = ArduinoCloud.getLocalTime();
141+
```
142+
143+
***`ArduinoCloud.getLocalTime()` returns the Unix Time Stamp (counted in seconds).***
144+
129145
### Messenger
130146

131147
![Messenger Widget](assets/widget-messenger.png)

0 commit comments

Comments
 (0)