Events are specific occurrences or incidents that happen within your time series data. They are associated with a particular date and time and Ubidots allows you to send alerts and notifications based on them, with the possibility of adding the timestamp in a datetime format inside the message.
The default datetime format used in Ubidots for events is quite straightforward. It follows a standard format that includes the year, month, day, hour, minute, and second. The format is as follows: "YYYY-MM-DD HH:MM:SSZ".
Let's break down the format:
- YYYY: Represents the four-digit year of the event.
- MM: Stands for the two-digit month of the event (01 for January, 02 for February, and so on).
- DD: Represents the two-digit day of the event (01 for the first day of the month, 02 for the second day, and so on).
- HH: Represents the two-digit hour of the event in a 24-hour format (00 for midnight, 01 for 1 am, and so on).
- MM: Stands for the two-digit minute of the event (00, 01, 02, etc.).
- SS: Represents the two-digit second of the event (00, 01, 02, etc.).
- Z: This letter denotes that the time is in the UTC (Coordinated Universal Time) time zone.
Modify the default datetime.
Suppose that we would like the datetime to show as day/month/year hours minutes seconds, therefore the datetime format would be '%d/%m/%y %H:%M:%S'. This modification would require you to access the timestamp placeholder by double-clicking on it and then adding that format after the timezone in a single quote as seen below.
(Click on the video to watch it on a different tab).
Modify the timezone
As you may have noticed, the events inherit the timezone set on your account preferences but you can opt to modify it for the event's notifications and enter any of the timezones supported and available on your account preferences. Make sure to write it inside a single quote.
Check the results
Once the event gets saved and triggered, you will see that new datetime format in the incoming message.