IT Community - Software Programming, Web Development and Technical Support

How can I display today's date on my home page in the following styles...?

This is a discussion on How can I display today's date on my home page in the following styles...? within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all... How can I display today's date on my home page in the following styles...? Thanks......


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 12-18-2007, 05:32 AM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 547
itbarota is on a distinguished road
Default How can I display today's date on my home page in the following styles...?

Hi all...


How can I display today's date on my home page in the following styles...?


Thanks...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-18-2007, 05:36 AM
sathian sathian is offline
D-Web Analyst
 
Join Date: Aug 2007
Posts: 252
sathian is on a distinguished road
Default Re: How can I display today's date on my home page in the following styles...?

Use following script to disply todays date,

<script language="JavaScript"><!--
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}

var months = new makeArray('January','February','March',
'April','May','June','July','August','September',
'October','November','December');

var date = new Date();
var day = date.getDate();
var month = date.getMonth() + 1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;

document.write(day + " " + months[month] + " " + year);
//--></script>

Thanks
Sathian.K
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-18-2007, 05:38 AM
Pvinothkumar Pvinothkumar is offline
D-Web Analyst
 
Join Date: Sep 2007
Posts: 237
Pvinothkumar is on a distinguished road
Default Re: How can I display today's date on my home page in the following styles...?

Hi all...


<script language="JavaScript">
var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;

document.write(day + "/" + month + "/" + year);
</script>


Thanks...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-18-2007, 06:30 AM
velhari velhari is offline
D-Web Programmer
 
Join Date: Mar 2007
Location: Chennai
Posts: 67
velhari is on a distinguished road
Send a message via AIM to velhari
Default Re: How can I display today's date on my home page in the following styles...?

Quote:
Originally Posted by itbarota View Post
Hi all...

How can I display today's date on my home page in the following styles...?

Thanks...
Hi,

You didnt specify style of displaying the date.

Can you define what style you need to display the date......?
__________________
Regards,
VELHARI
I am not totally useless. I can be used for a bad example
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 12-18-2007, 10:50 PM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Smile Re: How can I display today's date on my home page in the following styles...?

<script language="text/javascript">
function dateline() {
now=new Date(); // create current date/time object
dayNames=['Sunday','Monday,','Tuesday','Wednesday','Thursday ','Friday',
'Saturday'];
monthNames=['January','February','March','April','May','June', 'July',
'August','September','October','November','Decembe r'];
dater=dayNames[now.getDay()]+", "+monthNames[now.getMonth()]+
" "+now.getDate()+", "+now.getFullYear();
return dater;
};
function timeline() {
now=new Date();
hours=now.getHours();
mins=now.getMinutes();
ampm="AM";
if(hours>=12) {ampm="PM"};
if(hours > 12) {hours=hours-12};
timer=hours+":"+mins+" "+ ampm;
return timer;
};
function datetime() {
dt=dateline()+' at '+timeline();
return dt;
}
</script>
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
'Page' ia an unambiguous reference between 'System.Web.UI.Page' and 'Project1.Page' poornima ASP and ASP.NET Programming 1 03-05-2008 03:12 AM
display the date in the format weekday, dd, month, year, for example Friday, 11 Dec98 itbarota HTML, CSS and Javascript Coding Techniques 1 02-18-2008 08:31 PM
How do you restrict page errors display in the JSP page? sundarraja ASP and ASP.NET Programming 1 02-07-2008 11:33 PM
How can I show the documents last modified date in the format: month, date, year, tim Pvinothkumar HTML, CSS and Javascript Coding Techniques 3 12-28-2007 05:58 AM
How to convert a date to a globally accepted date format, in DOT NET 2005? Archer C# Programming 1 07-25-2007 03:21 AM


All times are GMT -7. The time now is 01:11 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0