DAQconnect and Human Readable Time Function


Recommended Posts

I can get the system time to show with the following in a variable value box:


I have tried to use "dateTime.dateFormat" to convert the milliseconds since 1970, but have been unsuccessful. I have tried a number of combinations of the two date and time functions, such as:


How can I display human readable date and time?


Link to comment
Share on other sites

It would be:



dateTime.printTime(dateTime.systemTime(), false, false)

where the first false means you don't want ms displayed, and the second means no seconds displayed.

There's also:

dateTime.printDateTime(dateTime.systemTime(), false)

where the false means no ms displayed.

Of course none of these functions require you to use dateTime.systemTime(). You can use the time of any data point as well.

Finally, dateTime.timeFormat is a variable for setting the date ordering. Its not a function. Usually it would go in the Load event of the page. For example, if you were in Europe (or much of the non-US world...), you might put:

dateTime.timeFormat = "dmy"

to get printDate() to display in day/month/year format. Note that the graph uses these same functions, so timeFormat affects graphs as well.

Link to comment
Share on other sites

  • 5 months later...
  • 2 weeks later...

Thanks - got it - I should have realised that from a previous post in thid thread

Link to comment
Share on other sites

  • 5 months later...

I tried to create a digital clock on the screen using a "Variable Value Component" and with the expression dateTime.printDateTime(dateTime.systemTime(), false)

Does not work, I'm stuck!

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.