# How to list all timezones in editor using moment-timezone

**URL:** <https://discourse.nodered.org/t/how-to-list-all-timezones-in-editor-using-moment-timezone/72802>\
**Category:** Developing Nodes\
**Created:** [28 December 2022 06:42 UTC](https://discourse.nodered.org/t/how-to-list-all-timezones-in-editor-using-moment-timezone/72802 "2022-12-28T06:42:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![syedhannan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/syedhannan/32/72932_2.png) [@syedhannan](https://discourse.nodered.org/u/syedhannan)\
**Post date:** [28 December 2022 06:42 UTC](https://discourse.nodered.org/t/how-to-list-all-timezones-in-editor-using-moment-timezone/72802/1 "2022-12-28T06:42:56Z")

</div>

I am creating a select tag in the editor and I want to display the list of all timezones using moment-timezone package

Is there any way I can use an external package in my editor?

If yes, then how do I need to import it inside **oneditprepare** function?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [28 December 2022 07:51 UTC](https://discourse.nodered.org/t/how-to-list-all-timezones-in-editor-using-moment-timezone/72802/2 "2022-12-28T07:51:31Z")

</div>

You can create an endpoint in the js and call it from your html

Alternatively you can place a static file (JSON) in a resources directory

[https://nodered.org/docs/creating-nodes/resources](https://nodered.org/docs/creating-nodes/resources)

---

<div class="post-metadata">

**Author:** ![syedhannan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/syedhannan/32/72932_2.png) [@syedhannan](https://discourse.nodered.org/u/syedhannan)\
**Post date:** [28 December 2022 09:55 UTC](https://discourse.nodered.org/t/how-to-list-all-timezones-in-editor-using-moment-timezone/72802/3 "2022-12-28T09:55:16Z")

</div>

Is this how we need to write the endpoint?

```auto
  RED.httpAdmin.get(
    "/serialports",
    RED.auth.needsPermission("serial.read"),
    function (req, res) {
      
    }
  );

```

But I am not sure how I need to add my code there.

Can you please share a resource about creating endpoints and connecting them in html.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 December 2022 12:52 UTC](https://discourse.nodered.org/t/how-to-list-all-timezones-in-editor-using-moment-timezone/72802/4 "2022-12-28T12:52:55Z")

</div>

> [@syedhannan](#):
>
> I am creating a select tag in the editor and I want to display the list of all timezones using moment-timezone package

You know that Node.js has full support for the INTL standard JavaScript library right? It is very comprehensive and, unlike moment, still in active development.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [26 February 2023 12:53 UTC](https://discourse.nodered.org/t/how-to-list-all-timezones-in-editor-using-moment-timezone/72802/5 "2023-02-26T12:53:41Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
