1

im looking for the function in jquery, that giveme the same format of time, like this.

date( 'Y-m-d\TH:i:sP');
//the output is like this.
2013-10-30T18:10:28+01:00

I need this kind of format but in jquery, for put in my var.

Thanks!

Deimos
  • 269
  • 1
  • 6
  • 17

1 Answers1

1

Neither JavaScript nor jQuery have built-in library methods for doing this in one step. You can find various plugins to help, or write your own:

See Where can I find documentation on formatting a date in JavaScript?

And check out http://momentjs.com/ or https://github.com/phstc/jquery-dateFormat

Community
  • 1
  • 1
Palpatim
  • 9,074
  • 35
  • 43