mc-Things General Discussion > mc-Things General Discussion

TimeStamps

(1/2) > >>

bdevlin:
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

mc-John:
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.

bdevlin:
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.

mc-John:
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?

bdevlin:
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.

Navigation

[0] Message Index

[#] Next page

Go to full version