I just built my own first off the whim programme (ish not really its a few lines of code!)

I have self taught myself almost everything all holistic learning.
I am currently learning JavaScript and randomly thought oh lemme make this and it worked so yeah I’m super happy thought id share it show some love.
Or maybe how you would change it or make it better advice is always appreciated!

let time = 2400;
amOrPm = ‘’;
function whatTime(hours) {
return hours = time - 1200;
}
function AMORPM(time) {
if (time < 1800 && time > 1159) {
time = time + ‘AM’; console.log(time);

}
else if (time < 0 || time > 2400) {
console.log(‘Error Incorrect Timing’);
}

else {
time = time + ‘PM’; console.log(time);
}
;

}

AMORPM(2500);