# Convert tag format string to moment.js/numeral.js format for perspective components

**URL:** <https://forum.inductiveautomation.com/t/convert-tag-format-string-to-moment-js-numeral-js-format-for-perspective-components/70443>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [February 28, 2023, 9:46pm UTC](https://forum.inductiveautomation.com/t/convert-tag-format-string-to-moment-js-numeral-js-format-for-perspective-components/70443 "2023-02-28T21:46:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [February 28, 2023, 9:46pm UTC](https://forum.inductiveautomation.com/t/convert-tag-format-string-to-moment-js-numeral-js-format-for-perspective-components/70443/1 "2023-02-28T21:46:57Z")

</div>

Is there any way to convert tag formatString based on java Format to moment.js format used by perspective components ?

Especially datetime and decimal number format

---

<div class="post-metadata">

**Author:** ![Gurjot\_Sandhu](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gurjot_sandhu/32/38368_2.png) [@Gurjot\_Sandhu](https://forum.inductiveautomation.com/u/Gurjot_Sandhu)\
**Post date:** [March 8, 2023, 6:32pm UTC](https://forum.inductiveautomation.com/t/convert-tag-format-string-to-moment-js-numeral-js-format-for-perspective-components/70443/2 "2023-03-08T18:32:05Z")

</div>

Hi [mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat),

Exactly where in Perspective are you trying to achieve this, an example would help?

You may be able to achieve this using scripting, perhaps using [system.date.format - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/system.date.format)  
or other system.date functions to extract from the datetime and do conversions.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [March 8, 2023, 7:46pm UTC](https://forum.inductiveautomation.com/t/convert-tag-format-string-to-moment-js-numeral-js-format-for-perspective-components/70443/3 "2023-03-08T19:46:56Z")

</div>

I came across this:

> <https://github.com/TheCoder4eu/BootsFaces-OSP/blob/master/src/main/java/net/bootsfaces/utils/LocaleUtils.java>

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [March 8, 2023, 8:48pm UTC](https://forum.inductiveautomation.com/t/convert-tag-format-string-to-moment-js-numeral-js-format-for-perspective-components/70443/4 "2023-03-08T20:48:53Z")

</div>

Thanks a lot @JordanCClark 👍

Perfect to convert **formatString from a datetime tag** to the **format** of a perspective **dateTime input or dateTime picker** components.

I'm looking for something to convert **formatString from a Float tag** to the **format** of a perspective **Numeric Entry Field** component.  
Seems to be based on **numeraljs** according the manual:

[https://docs.inductiveautomation.com/display/DOC81/Perspective+-+Numeric+Entry+Field](https://docs.inductiveautomation.com/display/DOC81/Perspective+-+Numeric+Entry+Field)

> **[Numeral.js](http://numeraljs.com/#format)**
>
> A javascript library for formatting and manipulating numbers.
