Author Topic: DateTime issues  (Read 317 times)


  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: DateTime issues
« on: January 10, 2017, 05:58:47 pm »
Thanks, that helped, don't know how I missed that.

Having a couple of other problems you might be able to help with:

Can't figure out the string format modifiers. Trying to create a string with leading 0's, ie 024, 005, 543 etc. I tried .toString("D3") and .toString("000") but these didn't work. Not a big deal, I'm working round it, but I'm sure if I knew what the formatters were it would be easy to do.

I'm also trying to get a timestamp (for including in json strings) with millisecond accuracy, but the RTC only has 1 second resolution. Any progress on the long data type or millis functions?

The reason I'm doing this is that I'm publishing some real time data, via both MQTT and via beacon. Right now I'm getting a conflict on rapid (sub 1second) events where the beacon data arrives at the same time as the mqtt data, and I can't tell which is more recent. I can tell when I get the data, but not when it was sent.

Any suggestions?