Kod Script Tarikh Auto

<!--mula script tarikh auto--> <script language="JavaScript"> <!-- Begin // Get today's current date. var now = new Date(); // Array list of days. var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); // Array list of months. var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December'); // Calculate the number of the current day in the week. var date = ((now.getDate()<10) ? "0" : "")+ now.getDate(); // Calculate four digit year. function fourdigits(number) { return (number < 1000) ? number + 1900 : number; } // Join it all together today = days[now.getDay()] + ", " + months[now.getMonth()] + " " + date + ", " + (fourdigits(now.getYear())) ; // Print out the data. document.write("" +today+ ""); // End --> </script> <!--tamat script tarikh auto-->

1 Response

Copy paste kod je kod kat bawah ni jika nak buat dia ada teks nama dan tarikh :

<div style="text-align: center;">
<span style="font-family: &quot;georgia&quot; , &quot;times new roman&quot; , serif; font-size: medium;"><span style="color: black;"><span style="font-family: &quot;georgia&quot; , &quot;times new roman&quot; , serif; font-weight: bold;">From :</span><span style="background-color: yellow; font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;"><b>Ariffin Hamzah</b></span></span></span></div>
<div style="text-align: center;">
<span style="font-family: &quot;georgia&quot; , &quot;times new roman&quot; , serif; font-size: medium;"><span style="color: black;"><span style="font-weight: bold;">Date:</span>&nbsp;</span><!--mula script tarikh auto-->
<script language="JavaScript">
<!-- Begin
// Get today's current date.
var now = new Date();
// Array list of days.
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
// Array list of months.
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}
// Join it all together
today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;
// Print out the data.
document.write("" +today+ "");
// End -->
</script><!--tamat script tarikh auto--></span></div>

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.