Author Topic: Current time in HH:MM:SS  (Read 1286 times)


  • Full Member
  • ***
  • Posts: 167
    • View Profile
    • mc-Things
Re: Current time in HH:MM:SS
« on: July 26, 2016, 05:28:37 pm »

Seems like the .ToString documentation is missing the format information. We will be adding that but for now, DateTime is in ISO8601 format which by default has a string representation that looks like this: YYYY-MM-DDTHH:MM:SS+hh:mm. You can use .ToString("L") for local time to get the time in your local time with no timezone information or use .ToString("Z") to get Zulu (UTC) time.

The other option is to use the documented functions of the DateTime object to extract the hour, minute, and second information and manually form a timestamp in your desired format.

It is probably worth mentioning that mc-Script is a VB.NET like language in its syntax. We do not support all the functionality of the .NET framework.

Also if you update to the latest mc-Gateway Host Processor firmware, you should be able to connect to your module and reprogram it. It is not bricked. It has entered debug mode since your code did not successfully create a string (since "HH':'mm':'ss" is not a valid format string) and tried to add it to a ListOfByte. This would have caused a run-time error which you did not see since you didn't debug the code. Beacons are not sent when device enters debug mode.