convert date(string) to date (date time


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: convert date(string) to date (date time

  1. #1
    Join Date
    Apr 2007
    Posts
    3

    convert date(string) to date (date time

    Dear All

    please,help me i want to convert date(string) to date (date time), this date i make setting for day with one (constant)
    to use it in database i write in html
    <html>
    <head>
    <SCRIPT type="text/javascript">
    function startDate()
    {
    var d=new Date()
    var y=d.getYear()
    var m=d.getMonth()+1
    var day=1
    var date=m+"/"+day+"/"+y

    document.write("date is: "+date)

    // OUTPUT WILL BE 4/1/2007 THIS IS STRING I NEEED IT DATETIME //

    var dat=Date.parse(date);
    document.write("date is: "+dat)

    // OUTPUT WILL BE 1175378400000 //

    // PLEASE HELP ME TO GET TRUE RESULT //
    }
    </SCRIPT>
    </head>
    <body onload="startDate()" >
    </body>
    </html>

  2. #2
    Join Date
    Jun 2004
    Posts
    199
    Do you want to do this in Java?

Similar Threads

  1. Date and Time comparison
    By rtwitty in forum VB Classic
    Replies: 4
    Last Post: 02-24-2005, 01:12 PM
  2. Date Time
    By Tom in forum .NET
    Replies: 0
    Last Post: 08-06-2002, 11:13 AM
  3. Beta2 Southern Hemisphere Blues
    By Esmond Hart in forum .NET
    Replies: 2
    Last Post: 01-14-2002, 07:24 AM
  4. Convert char data to date
    By wang in forum Database
    Replies: 1
    Last Post: 05-19-2000, 05:20 PM
  5. File Date & Time
    By Joe P in forum authorevents.appleman
    Replies: 1
    Last Post: 04-11-2000, 04:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center