cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Date.now() to the Day of the Week Name

Damone
New Contributor

This may have been asked before, but I can’t find a solution. I need to extract the weekday name from the current date. In other words, today is March 8. I need ‘Monday’. Date.now().getDay() returns the number 1.

1 ACCEPTED SOLUTION

koryknick
Employee
Employee

Try this: Date.now().toLocaleDateString( { ‘format’ : ‘EEEE’ })

View solution in original post

4 REPLIES 4

koryknick
Employee
Employee

Try this: Date.now().toLocaleDateString( { ‘format’ : ‘EEEE’ })

That works! I never would have thought of that. (I’m a complete SnapLogic newbie). One more question, do you know of a way to make it all uppercase? Thank you very much!

koryknick
Employee
Employee

Date.now().toLocaleDateString( { ‘format’ : ‘EEEE’ } ).toUpperCase()
🙂

You’re awesome. Thank you