Jump to content
Sign in to follow this  
BobbyRachel

How to remove time portion of date using javascript?

Recommended Posts

i have a javascript variable which holds date time value... i need only date from it...

<script type="text/javascript">    function update(){    var datefield = document.getElementById("myTextBox_CWPWORKLIST.DUE_DATE").value;    alert(datefield);    }    </script>

here the datefield = 2013-02-21 00:00:00.0... i need datefield = 2013-02-21.. how to get this..

Share this post


Link to post
Share on other sites

i got the answer....

  <script type="text/javascript">    function update(){    var datefield = document.getElementById("myTextBox_CWPWORKLIST.DUE_DATE").value;    alert(datefield);var columnname = dateFormat(datefield, "dd-mm-yy");alert(columnname);    }    </script>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...