I am getting date in 2015-10-30T05:00:00Z
format from a SharePoint list
using rest.
Please help me to get the date in 2015-10-30
format using JavaScript.
|
||||
SharePoint adds a
Note: String.format is defined in |
||||
|
I would strongly suggest using the MomentJS library for all date/time work client side. Writing JavaScript functions to handle this stuff is so 2000s at this point. I load MomentJS into every client side project I do these days. |
|||
|
Store the value retrieved from REST call in a variable and use JavaScript slice method to get the date part. Example:
|
|||||||||||||||||
|
If you're in a provider hosted app (or working with non .NET folks) you may want to use plain old Javascript; here is a technique that doesn't rely on string manipulation, if you're worried about that:
Then you can pass in a new Note that |
|||
|
2015-10-30
? Why would you want10th
as well as2015-10-30
– Nadeem Yousuf yesterday