Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Converting unix epoch timestamp

Featured Replies

Posted

Hi @Jimbo.Automates, As you know the Unix epoch timestamp is one of the fields available for each Airthings device (at least the Wave Plus devices anyway). I'd like to be able to use it to know how long it's been since a device was last updated in seconds or minutes and trigger an event/notification if it's been too long. I feel like I would need to either convert it to YYYYMMDDDHHMMSS or be able to get/calculate the current epoch time 'now' so I can do the math using ISY programs.

About 99% of my google search results for the formula or algorithm to convert current time to unix epoch time were either online calculators for human consumption, how to do it in Excel, or talked about using built in linux or windows commands, e.g. date +%s  in linux. (I tested the latter and it does work on the Polisy.) When I did find formula or algorithm info it was shell code or python, etc., which didn't translate well to ISY programming and made me think it was silly to try to do it using ISY programming. 

Instead I wondered if you could make the NS do the simple calculation of subtracting 'date +%s' from epoch time that the API provides (both have same 10 digit resolution) and display a "time since last updated" in minutes or seconds. As far as I'm concerned it could replace the current time field in NS/ISY because I can't see what other use the unix epoch time would have but if you wanted to have both, it's fine with me.

Thanks for considering it.

 

UDI is adding epoch time as a driver so it will be more useful soon. But yes I could add seconds or minutes since the last update as well.

Sent from my Pixel 6 Pro using Tapatalk

  • 7 months later...
Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.