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 specfic date and time format inside the message.
The default date and time 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 a.m., 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 date and time format:
Let's suppose that we would like the date and time format to be shown like this: day/month/year hours:minutes:seconds. Therefore the date and time format would be '%d/%m/%y %H:%M:%S'. This modification would require you to access the timestamp's placeholder within the event's action message. To do this:
1. Double click on it.
2. Add a comma after the time zone and then add the new format between single quotation marks, as in the next image.
Modify the time zone:
Events inherit the time zone set in your account preferences, but you can change it in the actions of a specific event by entering any of the supported time zones (you can check the supported time zones in 'account settings' ⟶ scroll down to 'preferences' ⟶ 'timezone' drop-down menu). Make sure to write the time zone between single quotation marks.
Check the results:
Once the event gets saved and triggered, the timestamp in the message will follow the new.