RobDog888
Aug 20th, 2004, 12:50 PM
I need to format a date/time stamp in one of my pages in my
robohelp help file. It supports Javascript so I modified the page
code, but ran accross a issue where I need to format this stamp
with "MM-DD-YY_H-MM-SS". I want this to be dynamic so when
the user clicks the help page the current date and time will be
displayed and formatted. I am having trouble with single digit
values. I need double digits for all values. Here is what I have so
far...
<SCRIPT LANGUAGE="javascript">
function FormatDate() {
RightNow = new Date();
RightNow.getMonth()+1 + "-" + RightNow.getDate() + "-" + RightNow.getFullYear()
return true;
}
function FormatTime() {
RightNow = new Date();
RightNow.getHours() + "-" + RightNow.getMinutes() + "-" + RightNow.getSeconds();
return true;
}
function FormatStamp() {
RightNow = FormatDate(); + "_" + FormatTime();
return true;
}
</SCRIPT>How do I pass the values back and in the required format?
Thanks for any help.
robohelp help file. It supports Javascript so I modified the page
code, but ran accross a issue where I need to format this stamp
with "MM-DD-YY_H-MM-SS". I want this to be dynamic so when
the user clicks the help page the current date and time will be
displayed and formatted. I am having trouble with single digit
values. I need double digits for all values. Here is what I have so
far...
<SCRIPT LANGUAGE="javascript">
function FormatDate() {
RightNow = new Date();
RightNow.getMonth()+1 + "-" + RightNow.getDate() + "-" + RightNow.getFullYear()
return true;
}
function FormatTime() {
RightNow = new Date();
RightNow.getHours() + "-" + RightNow.getMinutes() + "-" + RightNow.getSeconds();
return true;
}
function FormatStamp() {
RightNow = FormatDate(); + "_" + FormatTime();
return true;
}
</SCRIPT>How do I pass the values back and in the required format?
Thanks for any help.