function timeData() {

//Get Date
months=new Array(13);
months[1]="JANUARY";
months[2]="FEBRUARY";
months[3]="MARCH";
months[4]="APRIL";
months[5]="MAY";
months[6]="JUNE";
months[7]="JULY";
months[8]="AUGUST";
months[9]="SEPTEMBER";
months[10]="OCTOBER";
months[11]="NOVEMBER";
months[12]="DECEMBER";
time=new Date();
dmonth=time.getMonth() + 1;
lmonth=months[time.getMonth() + 1];
date=time.getDate();
year=time.getYear();
if (year < 2000)
year = year + 1900;
if (dmonth < 10) { dmonth = "0" + dmonth }
if (date < 10) { date = "0" + date }

//Get Time
thetime=new Date();
hours=thetime.getHours();
mhours=thetime.getHours();
minutes=thetime.getMinutes();
mminutes=thetime.getMinutes();
seconds=thetime.getSeconds();
if (seconds < 10) { seconds = "0" + seconds }
if (mminutes < 10) { mminutes = "0" + mminutes }
if (mhours < 10) { mhours = "0" + mhours }
//var timeValue = "" + ((hours >12) ? hours -12 :hours)
timeValue = "" + hours;
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
//timeValue += (hours >= 12) ? " PM" : " AM";

//Get Day
days=new Array(7);
days[0]="SUNDAY";
days[1]="MONDAY";
days[2]="TUESDAY";
days[3]="WEDNESDAY";
days[4]="THURSDAY";
days[5]="FRIDAY";
days[6]="SATURDAY";
lday=days[time.getDay()];

datestring = year + "-" + dmonth + "-" + date + " " + mhours + ":" + mminutes + ":" + seconds;

}

timeData();