ledbelly2142 Posted October 19, 2011 Share Posted October 19, 2011 I can get the system time to show with the following in a variable value box: dateTime.systemTime() 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: dateTime.dateFormat.dateTime.systemTime() How can I display human readable date and time? Thanks Link to comment Share on other sites More sharing options...
AzeoTech Posted October 20, 2011 Share Posted October 20, 2011 It would be: dateTime.printDate(dateTime.systemTime()) and 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 More sharing options...
ledbelly2142 Posted October 20, 2011 Author Share Posted October 20, 2011 Thank you very much. The "dateTime.printDateTime(dateTime.systemTime(), false)" was exactly what I was looking for, showing date and time: xx/xx/xx xx:xx:xx Regards Link to comment Share on other sites More sharing options...
hschir Posted April 1, 2012 Share Posted April 1, 2012 How do get to print in d,m,y ? Link to comment Share on other sites More sharing options...
AzeoTech Posted April 2, 2012 Share Posted April 2, 2012 dateTime.dateFormat = "dmy" Put that in the OnLoad event of the page. Link to comment Share on other sites More sharing options...
hschir Posted April 15, 2012 Share Posted April 15, 2012 Thanks - got it - I should have realised that from a previous post in thid thread Link to comment Share on other sites More sharing options...
Technidyne Posted September 17, 2012 Share Posted September 17, 2012 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 More sharing options...
AzeoTech Posted September 20, 2012 Share Posted September 20, 2012 First, are you using DAQConnect or DAQFactory? This is for DAQConnect only (which uses Javascript). I just verified that the above works just fine in DAQConnect. In DAQFactory you would do: formatDateTime("%c", systime()) Link to comment Share on other sites More sharing options...
Technidyne Posted September 21, 2012 Share Posted September 21, 2012 Ok, I see........Works Great, thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.