Forum Discussion

SteveMarlow-0fc's avatar
SteveMarlow-0fc
Community Member
2 years ago

Javascript variable / Current Date

Hello, Can someone give me the javascript to display the current date by using a variable? It is similar to the below javascript but I need it to display the date numerically like "06/20/2023" 

var options = {weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }; var date = new Date().toLocaleTimeString('en-us', options); var player = GetPlayer(); player.SetVar("SystemDate",date);