function formatDate(date) {
const pad = (num) => (num < 10 ? '0' + num : num);
const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
return `${days[date.getDay()]}, ${months[date.getMonth()]} ${date.getDate()}, ${date.getFullYear()}`;
}
function getCurrentDate(offset) {
// Get the current date/time
let now = new Date();
// Convert local time to UTC, then add the offset and convert to milliseconds
let utc = now.getTime() + (now.getTimezoneOffset() * 60000);
let newDate = new Date(utc + (3600000 * offset));
// Format the date and time
return formatDate(newDate);
}
// Change -6 to your GMT offset
yourVoiceflowVarName = getCurrentDate(-6);