How i can get the current date with a specific format \'yyyy-MM-dd\', for today by example i with that the result be: \'2018-07-12\', with using just the command
<
Use the following:
new Date().toLocaleDateString();
Then as per your requirement just change locale for your application:
import { registerLocaleData } from '@angular/common';
import localeFr from '@angular/common/locales/fr';
registerLocaleData(localeFr);
//Provide the locale in any Module or Component by the LOCALE_ID token.
providers: [
{provide: LOCALE_ID, useValue: 'fr'}
]