i use this code to regenerate the date and time for my program but i need the time in 12 hours (am, pm) format, not in 24 hours format
var time = OS.get_datetime()
var nameweekday= ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
var namemonth= ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
var dayofweek = time["weekday"] # from 0 to 6 --> Sunday to Saturday
var day = time["day"] # 1-31
var month= time["month"] # 1-12
var year= time["year"]
var hour= time["hour"] # 0-23
var minute= time["minute"] # 0-59
var second= time["second"] # 0-59
var dateRFC1123 = str(nameweekday[dayofweek]) + " " + str("%02d" % [day]) + " " + str(namemonth[month-1]) + ", " + str("%02d" % [hour]) + ":" + str("%02d" % [minute])
note: this code is not my own i got it from another question here in Godot forum.