Results 1 to 4 of 4

Thread: Date Script at HTML

  1. #1
    Join Date
    Apr 2009
    Posts
    79

    Date Script at HTML

    I a looking for code in html to display date and time. The code must display current date and time. Is that possible to display previous date and time with the same code, if yes then what are syntax need to declare for current and previous date format.

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Date Script at HTML

    HTML codes for date :
    Code:
    <script language="JavaScript">
    <!--
    date=Date()
    document.write(date)
    //-->
    </script>

  3. #3
    Join Date
    Jan 2009
    Posts
    199

    Re: Date Script at HTML

    Code:
    <Script type="text/javaScript"> 
    
    // current date. 
    var nw = new Date(); 
    
    
    var dys = new Array('Sund','Mon','Tues','Wed','Thur','Fri','Sat'); 
    
    // Array list of months. 
    var months = new Array('Jan','Feb','Mar','Ap','Ma','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); 
    
    var date = ((now.getDate()<10) ? "0" : "")+ now.getDate(); 
    
    function fourts(number)   { 
       return (number < 1000) ? number + 1900 : number; 
                            } 
    tod =  days[now.getDay()] + ", " + 
             months[now.getMonth()] + " " + 
             date + ", " + 
             (fourdigits(now.getYear())) ; 
    
    document.write(tod); 
    
    //  End --> 
    </script>

  4. #4
    Join Date
    Dec 2008
    Posts
    177

    Re: Date Script at HTML

    Try the following code to display date in html
    Code:
    <script type="text/javascript">
    var da=new Date();
    var weda=new Array
    ("Sun","Mon","Tue","Wed","Thu","Fri", "Sat");
    var month=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
    document.write(weekday[da.getDay()] + " ");
    document.write(da.getDate() + ". ");
    document.write(monthname[da.getMonth()] + " ");
    document.write(da.getFullYear());</script>

Similar Threads

  1. Where can I get free HTML Wallpaper Script
    By Brexton in forum Software Development
    Replies: 4
    Last Post: 17-01-2011, 07:55 AM
  2. Date field in HTML form
    By Messenger in forum Software Development
    Replies: 6
    Last Post: 29-07-2010, 10:30 AM
  3. PHP Decoder for HTML Script
    By Mind It in forum Software Development
    Replies: 3
    Last Post: 29-09-2009, 02:36 PM
  4. Date, days in HTML
    By Jacob in forum Software Development
    Replies: 4
    Last Post: 09-02-2009, 09:17 PM
  5. Script insert date in the name of my file
    By Viensterrr in forum Software Development
    Replies: 4
    Last Post: 31-10-2008, 07:18 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,694,955.19081 seconds with 16 queries