Author Topic: TimeStamps  (Read 329 times)

bdevlin

  • Newbie
  • *
  • Posts: 38
    • View Profile
TimeStamps
« 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

Share on Facebook Share on Twitter Share on Google+


mc-John

  • Global Moderator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: TimeStamps
« Reply #1 on: April 15, 2017, 05:27:47 pm »
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

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: TimeStamps
« Reply #2 on: April 15, 2017, 05:43:36 pm »
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

  • Global Moderator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: TimeStamps
« Reply #3 on: April 18, 2017, 10:22:37 am »
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

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: TimeStamps
« Reply #4 on: April 20, 2017, 03:37:21 pm »
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.
Like Like x 1 View List

Nick_W

  • Full Member
  • ***
  • Posts: 214
    • View Profile
Re: TimeStamps
« Reply #5 on: May 20, 2017, 01:32:29 pm »
My Time library has this function in it:

Code: [Select]
Shared Function GetTimestamp(format As TIME_FORMAT, TimestampOffset As Integer) As String
used for unix type time stamps. Might do what you want...