mc-Things
General Category => mc-Things General Discussion => Topic started by: bdevlin on April 12, 2017, 01:37:07 pm
-
Does anyone have a GetTime() functions of sorts. Perhaps we can use the various cloud time servers. I don't know how to do it though. I know I can just stamp the data as it streams into my MQTT server, but I am just toying with a few options.
Thanks,
Brad
-
I don't understand what you are asking but the gateways get their time from the specified SNTP server and the devices get their time from the gateway every 24 hour.
-
Well, basically, what is the time stamp variable for my script when it transmits data from the module. I'm not aware I can add code that executes from the gateway to fetch that timestamp, in my mobile script. If I need to get the transmission datetime from a receiver, rather that a module, that's fine. I just don't see if it's possible or not.
-
You can get the time from the module "DataTime.Now()", which is updated by the gateway daily, and add that to your message. Would that work?
-
That's what I need thanks. There is also a comprehensive parsing example in the MQTT section from another member I may need to borrow script from.
-
My Time library has this function in it:
Shared Function GetTimestamp(format As TIME_FORMAT, TimestampOffset As Integer) As String
used for unix type time stamps. Might do what you want...