Reputation: 75
I want to display my current date format like this Format I want
Currently I'm using like this, this is the code in my home.ts
myDate: String = new Date().toISOString();
I display the date in home.html
like this
Date : {{myDate}}
and it show like this Format I don't want
How can I display it like the first image ?
I've done a lot of research and none of it meet my requirement.
Upvotes: 2
Views: 1204
Reputation: 488
Casting ur date using yourDate.toDateString()
Generat2s somethibg like "Thu October 26 2015". If you dont want the day of the weak you can manipulate the string. If you really want it the way you stated you can use string.split( )
and rearrange the resulting entries in the array
Upvotes: 2