Friday, March 14, 2008 This is what the section of code looked like before I pasted in your code. Friday, March 14, 2008 Santa Barbara, California [h]Text[/h][b]Text[/b] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => DJenae [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 6 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> Current day and date - Macromedia Dynamic HTML

Current day and date - Macromedia Dynamic HTML

I've created a fairly simple website in which I've inserted the day and date and want it to update automatically according to my location, which is the same as the server. Currently, it is in the following format: Friday, March 14, 2008. I've not been able to find a simple, clear, step by step answer in my online searches. I am not a programmer so if you tell me about code you may need to provide a little extra detail. Do I need to create an html or shtml page for this code instruction or can I simply insert some ...

  1. #1

    Default Current day and date

    I've created a fairly simple website in which I've inserted the day and date
    and want it to update automatically according to my location, which is the same
    as the server. Currently, it is in the following format: Friday, March 14,
    2008. I've not been able to find a simple, clear, step by step answer in my
    online searches. I am not a programmer so if you tell me about code you may
    need to provide a little extra detail. Do I need to create an html or shtml
    page for this code instruction or can I simply insert some magic code into my
    current html page? Thanks for your time and help with this!

    DJenae Guest

  2. #2

    Default Re: Current day and date

    Hi, well considering your coding knowledge I would like to suggest you to use
    this javascript code. All you need to do is to copy it and paste it into the
    desired location. It will print out the format you would like to make display.


    <script type="text/javascript">
    var d=new Date();

    var weekday=new Array(7);
    weekday[0]="Sunday";
    weekday[1]="Monday";
    weekday[2]="Tuesday";
    weekday[3]="Wednesday";
    weekday[4]="Thursday";
    weekday[5]="Friday";
    weekday[6]="Saturday";

    var month=new Array(12);
    month[0]="January";
    month[1]="February";
    month[2]="March";
    month[3]="April";
    month[4]="May";
    month[5]="June";
    month[6]="July";
    month[7]="August";
    month[8]="September";
    month[9]="October";
    month[10]="November";
    month[11]="December";


    doent.write(weekday[d.getDay()]+", "+month[d.getMonth()]+" "+d.getDay()+",
    "+d.getFullYear());

    </script>

    Bagi Guest

  3. #3

    Default Re: Current day and date

    Actually it prints out all that code on the web page. What am I missing? Be nice... =)
    DJenae Guest

  4. #4

    Default Re: Current day and date

    Well, I think you inserted this into a wyswyg editor. You need to place it into the code so in coder view not in designer.
    Good luck:)
    Bagi Guest

  5. #5

    Default Re: Current day and date

    I highlighted the day/date text on my html page, then in code view I replaced
    the now highlighted code, related to the text, with what you sent. Dreamweaver
    CS3, by the way. Obviously I need to understand more about code and tags. Your
    thoughts in the meantime?

    DJenae Guest

  6. #6

    Default Re: Current day and date

    First, thanks for your help with this.
    I replaced this line of code with the code you sent me:
    <!-- #BeginDate format:fcAm1 -->Friday, March 14, 2008<!-- #EndDate -->

    This is what the section of code looked like before I pasted in your code.
    <!--DWLayoutTable-->
    <tr>
    <td width="558" height="33" valign="middle" class="style1">
    <!-- #BeginDate format:fcAm1 -->Friday, March 14, 2008<!-- #EndDate
    --></td>
    <td width="234" align="center" valign="middle"><span
    class="style1">Santa Barbara, California</span></td>
    </tr>
    </table>
    <table width="792" border="0" cellpadding="0" cellspacing="0">
    [h]Text[/h]Text

    DJenae Guest

  7. #7

    Default Re: Current day and date

    DJenae wrote: 

    <script>
    doent.write(new Date());
    </script>

    Mick
    Mick Guest

  8. #8

    Default Re: Current day and date

    <script>
    doent.write(new Date());
    </script>

    Mick
    [/q]

    Thanks Mick but this didn't work either. It must be the placement. Please read
    the 2 posts before yours to see how I inserted the code suggestions. This is
    that section of code that includes what you sent me.

    <tr>
    <td width="558" height="33" valign="middle" class="style1"><script><br />
    doent.write(new Date());<br />
    </script></td>
    </tr>

    DJenae Guest

  9. #9

    Default Re: Current day and date

    DJenae wrote: 
    <tr>
    <td width="558" height="33" valign="middle" class="style1">
    <script>
    doent.write(new Date());
    </script>
    </td>
    </tr>

    Note removal of breaks, and BTW "height" is an illegal attribute for <td>
    Another way:
    <script>
    Date.prototype.normal=function(){
    return ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][this.getDay()]+
    ", "+
    ["Jan","Feb","Mar","Apr","May","Jun",
    "Jul","Aug","Sep","Oct","Nov","Dec"][this.getMonth()]+
    " "+
    this.getDate()+
    ", "+this.getFullYear();
    }
    </script>


    <tr>
    <td width="558" height="33" valign="middle" class="style1">
    <script>
    doent.write(new Date().normal());
    </script>
    </td>
    </tr>
    Mick
    Mick Guest

Similar Threads

  1. getting the current date/time
    By donalmurtagh@yahoo.co.uk in forum MySQL
    Replies: 20
    Last Post: February 20th, 05:08 PM
  2. Current Date
    By jhcaron in forum Macromedia Dynamic HTML
    Replies: 3
    Last Post: January 8th, 09:28 PM
  3. getting the current date
    By ranip in forum Dreamweaver AppDev
    Replies: 5
    Last Post: April 25th, 08:35 PM
  4. current date - 7 dayz?
    By mr_burns in forum PHP Development
    Replies: 3
    Last Post: October 8th, 08:10 AM

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
  •