# Which is the easiest way to get the week day?

**URL:** https://discourse.nodered.org/t/which-is-the-easiest-way-to-get-the-week-day/30865
**Category:** General
**Created:** [29 July 2020 09:47 UTC](https://discourse.nodered.org/t/which-is-the-easiest-way-to-get-the-week-day/30865 "2020-07-29T09:47:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [29 July 2020 09:47 UTC](https://discourse.nodered.org/t/which-is-the-easiest-way-to-get-the-week-day/30865/1 "2020-07-29T09:47:04Z")

</div>

I'm stuck.

I have `moment` and `simpletime`.

Which node gives me the weekday name?

I've found `msg.myday` from `simpletime`. But can `moment` give me the weekday name?

I don't mind using `simpletime`, but how things are, it will need a bit more work.  
Again, not a problem. Just asking.

---

<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: [29 July 2020 09:55 UTC](https://discourse.nodered.org/t/which-is-the-easiest-way-to-get-the-week-day/30865/2 "2020-07-29T09:55:33Z")

</div>

Use `dddd` in Moment to get full name or `ddd` to get short name

> **[Moment.js cheatsheet](https://devhints.io/moment)**
>
> The one-page guide to Moment.js: usage, examples, links, snippets, and more.

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [29 July 2020 09:59 UTC](https://discourse.nodered.org/t/which-is-the-easiest-way-to-get-the-week-day/30865/3 "2020-07-29T09:59:02Z")

</div>

(I should have known that. (^&&_^_% C.R.A.F.T. disease!)

---

<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: [29 July 2020 16:30 UTC](https://discourse.nodered.org/t/which-is-the-easiest-way-to-get-the-week-day/30865/4 "2020-07-29T16:30:48Z")

</div>

For anyone stumbling across this in the future and who doesn't want to use extra nodes (or JSONata since Moment is now built into that as well), should note that it is very simple to write a quick JavaScript function to do this. It is just a few lines of code.

---

<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: [12 August 2020 16:30 UTC](https://discourse.nodered.org/t/which-is-the-easiest-way-to-get-the-week-day/30865/5 "2020-08-12T16:30:48Z")

</div>

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