Formatting date javascript -
Formatting date javascript -
i'm using var datestring= new date(parseint(datestringunix));
, obtain string sun jun 10 2012 16:40:16 gmt+0200 (ora legale europa occidentale)
.
the question is: how can remove string part gmt+0200 (ora legale europa occidentale)
?
like this:
datestring = datestring.tostring().replace(/ gmt.*/,"");
the above replaces space before gmt
, , after gmt
including gmt
empyt string
.
i've used .tostring()
convert object
string
.replace()
can used.
javascript
Comments
Post a Comment