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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×