View Full Version : date
I know this is a sillt question but how do I format the date and time to get in a number format i.e: 20051103132458? I've found a lot of people who claim to know how to do that but I try these methods and still get Fri Nov 18 13:58:25 GMT-0500 2005.
I can't figure out what I'm doing wrong. Any help would be appreciated.
Thanks
arkanoid2k
11-18-2005, 08:38 PM
maybe this will help.
today_date = new Date();
date_str = ((today_date.getMonth() + 1) +":"+ today_date.getDate()+":" +
today_date.getFullYear());
trace(date_str)
thanks. the YEAR month and day work but when I tried to add " + today_Date.getHours() + today_Date.getMinutes() + today_Date.getSeconds()" it just gave NaN. do the time functions not work the same way?
arkanoid2k
11-18-2005, 09:51 PM
check the spelling of the VAR. it should be "today_date" all in small letters.
if you dont separete terms with the ":" the result will be de adittion of the values.
try using toString() to avoid the ":"
ah, I had today_Date instead of today_date. thanks.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.