I've got the current date from a datepicker widget in this format
but all in all it could be a better format dd MMMM yyyy if possible
how to convert it in timestamp ?
I could map the month but it's quite ugly ^^
Could you give me an example of what you have (e.g. "01-01-14) and what you want (e.g. "01 January 2014")
Sorry if this is obvious, I'm having a slow day
I want a timestamp like
possible with the right timezone
or new Date("26 January 2014").getTime()
Just do this:
var date = new Date("26-January-2014"),
timestamp = +date;
var date = new Date("26-January-2014");
give me NaN
What does the following command give you:
Take a closer look Pullo's code again. You didn't replicate the syntax properly.
it's simply a shortcut
I found the tricky pointmay be or sure my ff version it's buggy in the console also
give me NaN I tried it in the chrome console and it works thanks for the snippet
It's the hyphens in the date that FF is balking at, Chrome seems to accept them for some reason.
This will work in FF, too:
var date = new Date(("26-January-2014").replace(/-/g, " "));