“Javascript Data Formato” Respostas de código

Data do formato PHP

<?php
  // To change the format of an existing date
  $old_date_format = "20/03/1999";
  $new_data_format = date("Y-m-d H:i:s", strtotime($old_date_format));
Xenophobic Xenomorph

Javascript Data Formato

var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var today  = new Date();

console.log(today.toLocaleDateString("en-US")); // 9/17/2016
console.log(today.toLocaleDateString("en-US", options)); // Saturday, September 17, 2016
console.log(today.toLocaleDateString("hi-IN", options)); // शनिवार, 17 सितंबर 2016
Spongey Bob

Javascript Data Formato

new Date().toDateString();
//"Fri Jul 02 2021"
Amr Wafa

Javascript Data Formato

const d = new Date('2010-08-05')
const ye = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(d)
const mo = new Intl.DateTimeFormat('en', { month: 'short' }).format(d)
const da = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(d)

console.log(`${da}-${mo}-${ye}`)
Panicky Panda

Javascript Data Formato

function getDate(date) {
  let mydate = new Date(date);
  let day = mydate.getDate()
  let month = ["Januari", "Februari", "Maret", "April", "Mei", "Juni",
	"Juli", "Agustus", "September", "Oktober", "November", "Desember"
    ][mydate.getMonth()];
  return day + ' ' + month + ' ' + mydate.getFullYear();
}
Lubis Vermilion

Javascript Data Formato

Modern JavaScript date utility library https://date-fns.org/
date-fns provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js.
Monkey Monk

Respostas semelhantes a “Javascript Data Formato”

Perguntas semelhantes a “Javascript Data Formato”

Mais respostas relacionadas para “Javascript Data Formato” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código