DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links