I need to add time to a admin.database.ServerValue.TIMESTAMP and later retrieve it. But when I try to add additional time to theServerValue.TIMESTAMP I get an error:
getTime is not a function
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
const ten_secs = 10 * 1000; // 10 seconds
const daily_secs = 24 * 60 * 60 * 1000; // 24 hrs
const weekly_secs = 168 * 60 * 60 * 1000; // 1 week
exports.update = functions.https.onRequest((request, response) => {
    const currentTimeStamp = admin.database.ServerValue.TIMESTAMP;
    const updatedSecs = new Date(currentTimeStamp.getTime() + ten_secs); // should be saved in the db as milliseconds for later retrieve and calculations
    const updatedDay = new Date(currentTimeStamp.getTime() + daily_secs); // should be saved in the db as milliseconds for later retrieve and calculations
    const updatedWeek = new Date(currentTimeStamp.getTime() + weekly_secs); // should be saved in the db as milliseconds for later retrieve and calculations
    console.log("updatedSecs: " + updatedSecs + " | updatedDay: " + updatedDay + " | updatedWeek: " + updatedWeek);
    const ref = admin.database().ref('schedule').child("scheduleId_123").child("my_uid")
    ref.once('value', snapshot => {
        if (!snapshot.exists()) {
            return ref.set({ "updatedSecs": updatedSecs, "updatedDay": updatedDay, "updatedWeek": updatedWeek });
        } else {
            const retrieved_updatedSecs = snapshot.child("updatedSecs").val();
            const retrieved_updatedDay = snapshot.child("updatedDay").val();
            const retrieved_updatedWeek = snapshot.child("updatedWeek").val();
            const currentTime = Date.now();
            // do some calculations with the above values and currentTime.
        }
    });
}