I'm trying to format a time stamp but I'm having some trouble. Using the code below each time I want vDTime works fine but it seems really inefficient to repeat it every time. Unfortunately, if I separate it out (i.e., put it at the top of my script instead of within each statement requiring it), I get the time but it isn't formatted. Any suggestions? I don't mind the work of repeating this but I don't want to muck things up either. Thanks.
// Setup Time Stamp
if(getHour() < 10);
vHour = "0" + getHour();
if(getHour() >= 10);
vHour = getHour();
if(getMinute() < 10);
vMinute = "0" + getMinute();
if(getMinute() >= 10);
vMinute = getMinute();
vDTime = vHour + ":" + vMinute;
// Setup Time Stamp
if(getHour() < 10);
vHour = "0" + getHour();
if(getHour() >= 10);
vHour = getHour();
if(getMinute() < 10);
vMinute = "0" + getMinute();
if(getMinute() >= 10);
vMinute = getMinute();
vDTime = vHour + ":" + vMinute;
Comment