2

there is any way to do it? I know user can change this in his settings, but there is any way to change this in code? thanks

  • 1
    Possible duplicate of [Where can I find documentation on formatting a date in JavaScript?](http://stackoverflow.com/questions/1056728/where-can-i-find-documentation-on-formatting-a-date-in-javascript) – Garfield Jan 02 '17 at 12:22
  • this is not what I meant. I need to change the date on the header of the printed page – vegan world Jan 02 '17 at 18:09
  • what do you mean by printing on the header page? – Garfield Jan 03 '17 at 05:11
  • 1
    Referring to the format of the date that appears on the printed page. Good Valid Question.. – mkane May 08 '19 at 13:29

1 Answers1

0

You can use the JS Date type - Check out: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date

It can convert any date string to a specific locale. Or you can use its methods to build your own output.

Date d = new Date(dateString); //your current date as string
console.log(d.toLocaleDateString('en-US')); //for example US locale
fuma
  • 5,067
  • 4
  • 35
  • 39