function timeFromZone(arg) {
    let options = {
        timeZone: arg,
        hour12: false,
        hour: "numeric",
        minute: 'numeric',
        second: 'numeric',
    }

    let return_value;

    try {
        // this is the magic function. It takes those options and creates a custom formatter, and it will auto convert to whatever timezone is supplied.
        let formatter = Intl.DateTimeFormat([], options);

        return_value = formatter.format(new Date());
    } catch {
        return_value = "INVALID TIMEZONE";
    }

    return return_value;
}
// arg is the string value of the timezone. Timezones can be found in the csv file or the csvjson file
arg is the string value of the timezone. Timezones can be found in the csv file or the csvjson file
arg is the string value of the timezone . Timezones can be found in the csv file or the csvjson file
function timeFromZone(arg) {
    let options = {
        timeZone: arg,
        hour12: false,
        hour: "numeric",
        minute: 'numeric',
        second: 'numeric',
    }
    let return_value;
    try {
        let formatter = Intl.DateTimeFormat([], options);
        return_value = formatter.format(new Date());
    } catch {
        return_value = "INVALID TIMEZONE";
    }
    return return_value;
}
function timeFromZone ( arg ) { let options = { timeZone : arg , hour12 : false , hour : "numeric" , minute : 'numeric' , second : 'numeric' , } let return_value ; try { let formatter = Intl . DateTimeFormat ( [ ] , options ) ; return_value = formatter . format ( new Date ( ) ) ; } catch { return_value = "INVALID TIMEZONE" ; } return return_value ; }
arg is the string value of the timezone.
arg is the string value of the timezone .
// this is the magic function. It takes those options and creates a custom formatter, and it will auto convert to whatever timezone is supplied.