Actually the thing is that I am not able to push the realtime location of the user to the firebase rtdb and I had to make the value constant but this is really making my client disappointed, Here's the code:
firebase.initializeApp(firebaseConfig);
var database = firebase.database();
document.querySelector('#send').addEventListener('click', () => {
var username = document.getElementById("input").value;
var inout = document.getElementById("inout").value;
var today = new Date();
const monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
];
const dateObj = new Date();
const month = monthNames[dateObj.getMonth()];
const day = String(dateObj.getDate()).padStart(2, '0');
const year = dateObj.getFullYear();
const output = day + month + year;
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var lat = 22.992344005762106;
var lon = 88.39171958538499;
var data = {
name: username,
time: time + "," + inout,
lat: lat,
lon: lon
};
var firebaseRef = firebase.database().ref('users/' + output + time);
firebaseRef.set(data);
})