dates

Benchmark created on


Setup

const alertel = {
    "alert_id": "dI6rhJUBoA3tWizsLWjh",
    "alert_channel_id": 235,
    "alert_channel_name": "",
    "alert_channel_timezone_str": "Africa/Johannesburg",  
    "created": 1741687565.754486,
}

const formatterMap = new Map([[alertel.alert_channel_timezone_str, new Intl.DateTimeFormat("en-US", {timeZone: alertel.alert_channel_timezone_str,
            })]])

Test runner

Ready to run.

Testing in
TestOps/sec
baseline
const date =
            new Date(alertel.created * 1000).toLocaleDateString("en-US", {
              timeZone: alertel.alert_channel_timezone_str,
            });
ready
Intl
const formatter = formatterMap.get(alertel.alert_channel_timezone_str);
const date = formatter.format(new Date(alertel.created * 1000));
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.