Date Time Current

I created a “Label” on one of my windows using this script to show date and time. “dateFormat (Now (), “M D YY, H:MM a”)” I get an error when opening the window now that says "error executing expression for component ‘date time’ on property ‘text’. I understand that the date time is not totally text but I don’t know how to change the text of the label to a date format. Thank you for your help.

The ‘dateFormat’ function actually returns a string - all that’s wrong here is your format string. It should bedateFormat(Now(), "M d yy, H:mm a")The error is because the year part (“yy”) should be in lower case.

Another way I like to do it is to bind the text property of a label to a SQL query such asSELECT DATE_FORMAT(current_timestamp,"%H:%i %e/%m/%Y")(for MySQL). This ensures that all times displayed come from the server, so you don’t need to worry about keeping the time synchronised on every view node.

Hey, Thank you. AlThePal. It works! Finally I feel like I’m making progress. I like the forum and the valuable info out there. :prayer: