User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 423,550 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,969 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

convert date(string) to date (date time)

Join Date: Jun 2007
Posts: 1
Reputation: vikki.v is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vikki.v vikki.v is offline Offline
Newbie Poster

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

  #3  
Jun 7th, 2007
hi,
how can i convert
var dat=Date.parse(date);
("dat" has 1175378400000)

dat again to date (i.e.,4/1/2007)
thanx in advance

Originally Posted by Mohandsa View Post
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>
Reply With Quote  
All times are GMT -4. The time now is 6:07 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC