tags:

views:

26

answers:

2
<script type="text/javascript">dm();</script>

i am use this script it shows month October i need only oct please help me how to do it

in a html page

A: 

You haven't posted any code at all, so it's difficult to say what dm() actually does. However, assuming it returns a string and you want only the first 3 characters, this should work:

dm().substr(0, 3)
casablanca
`.toLowerCase()`
mykhal
+1  A: 

dm() is not a native function in Javascript. Nor is there a native way to get the month name.

Here's what I use:

['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][ (new Date() ).getMonth() ]
RickMeasham