Skip to content

Instantly share code, notes, and snippets.

@plushevy
Created August 15, 2018 15:13
Show Gist options
  • Save plushevy/fa21d158acc48d0682f5c12bbc1b0618 to your computer and use it in GitHub Desktop.
Save plushevy/fa21d158acc48d0682f5c12bbc1b0618 to your computer and use it in GitHub Desktop.
Вывод дат и времени
var optionsDay = {
weekday: 'long'
};
var optionsTime = {
hour: "2-digit",
minute: "2-digit"
};
var optionsDate = {
year: 'numeric',
month: 'numeric',
day: 'numeric',
};
var day = new Date().toLocaleString("ru", optionsDay);
var time = new Date().toLocaleString("ru", optionsTime);
var date = new Date().toLocaleString("ru", optionsDate);
\\"среда"
\\"20:12"
\\"15.08.2018"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment