Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.49 KB | None | 0 0
  1.  
  2.  
  3. var TodaysDateStyle = 15; //pick a style from below
  4.  
  5. /*---------------------------
  6. Style 15: Saturday March 17
  7. ----------------------------*/
  8.  
  9.  
  10. function WriteTodaysDate(Style) {
  11.  
  12. var months = new Array();
  13. months[1] = "January";  months[7] = "July";
  14. months[2] = "February"; months[8] = "August";
  15. months[3] = "March";    months[9] = "September";
  16. months[4] = "April";    months[10] = "October";
  17. months[5] = "May";      months[11] = "November";
  18. months[6] = "June";     months[12] = "December";
  19.  
  20. var months2 = new Array();
  21. months2[1] = "Jan"; months2[7] = "Jul";
  22. months2[2] = "Feb"; months2[8] = "Aug";
  23. months2[3] = "Mar"; months2[9] = "Sep";
  24. months2[4] = "Apr"; months2[10] = "Oct";
  25. months2[5] = "May"; months2[11] = "Nov";
  26. months2[6] = "Jun"; months2[12] = "Dec";
  27.  
  28. var days = new Array();
  29. days[1] = "Sunday";    days[5] = "Thursday";
  30. days[2] = "Monday";    days[6] = "Friday";
  31. days[3] = "Tuesday";   days[7] = "Saturday";
  32. days[4] = "Wednesday";
  33.  
  34. var days2 = new Array();
  35. days2[1] = "Sun"; days2[5] = "Thu";
  36. days2[2] = "Mon"; days2[6] = "Fri";
  37. days2[3] = "Tue"; days2[7] = "Sat";
  38. days2[4] = "Wed";
  39.  
  40. var todaysdate = new Date();
  41. var date  = todaysdate.getDate();
  42. var day  = todaysdate.getDay() + 1;
  43. var month = todaysdate.getMonth() + 1;
  44. var yy = todaysdate.getYear();
  45. var year = (yy < 1000) ? yy + 1900 : yy;
  46. var year2 = year - (2000*1); year2 = (year2 < 10) ? "0" + year2 : year2;
  47.  
  48. var dateline = new Array();
  49. dateline[1] = months[month] + " " + date + ", " + year;
  50. dateline[2] = months2[month] + " " + date + ", " + year;
  51. dateline[3] = date + " " + months[month] + ", " + year;
  52. dateline[4] = date + " " + months2[month] + ", " + year;
  53. dateline[5] = days[day] + " " + months[month] + " " + date + ", " + year;
  54. dateline[6] = days2[day] + " " + months[month] + " " + date + ", " + year;
  55. dateline[7] = days2[day] + " " + months2[month] + " " + date + ", " + year;
  56. dateline[8] = days[day] + " " + date + " " + months[month] + ", " + year;
  57. dateline[9] = days2[day] + " " + date + " " + months[month] + ", " + year;
  58. dateline[10] = days2[day] + " " + date + " " + months2[month] + ", " + year;
  59. dateline[11] = month + "/" + date + "/" + year2;
  60. dateline[12] = month + "/" + date + "/" + year;
  61. dateline[13] = date + "/" + month + "/" + year2;
  62. dateline[14] = date + "/" + month + "/" + year;
  63. dateline[15] = days[day] + " " + months[month] + " " + date;
  64. dateline[16] = days[day] + " " + date + " " + months[month];
  65.  
  66. document.write(dateline[Style]);
  67. }
  68.  
  69. WriteTodaysDate(TodaysDateStyle);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement