• Cursos
  • Code Compiler
  • Discussão
  • Preços
  • Equipas
Menu
0

JavaScript Working with dates - how to change military time to normal timing (12hrs)

In JavaScript, when you get newDate(), it gets the military time (24hrs). How do you change it to normal timing (12 hrs)? https://code.sololearn.com/WljuSoBuCIW3/?ref=app

htmljavascriptchangewebbody24documenttiming12hrsgetdate()
10th Jun 2019, 11:13 PM
Ginfio
Ginfio - avatar
1 Resposta
+ 1
date.toLocaleString('en-US') https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString https://code.sololearn.com/WuK38VeGfruw/?ref=app
11th Jun 2019, 12:52 AM
Gordon
Gordon - avatar

Tens frequentemente perguntas como esta?

Aprende de forma mais eficiente, gratuitamente:

  • Introdução ao Python

    7,1M de estudantes

  • Introdução ao Java

    4,7M de estudantes

  • Introdução ao C

    1,5M alunos

  • Introdução ao HTML

    7,5M alunos

Ver todos os cursos
Popular hoje
Hey I've done the C# and SQL beginner and intermediate, but still feel like there could be more... Is there advanced somewhere?
0 Votes
How to do a responsive page?
1 Votes
Running a python code
2 Votes
Can I make coding projects here and run them without sololearn pro, only in sololearn.
0 Votes
Is there any debugging practice here or not?
2 Votes
How create a new language ?
0 Votes
Hola
0 Votes
Ai in future
1 Votes
Issue with Sololearn Module Quiz Despite Correct Answers
1 Votes
How To Enable Disable Divs?
0 Votes