Outputting current time

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Outputting current time

    I output the current day/date on our web site home page. We recentlt moved
    to an american server that is 10 hours behing us in Australia. Whats the
    easiest way to add 10 hours to this date function to display the correct
    Australian date.


    <cfoutput>#DateFormat(Now(),
    "DDDD MMMM D ")# </cfoutput>


    bj Guest

  2. Similar Questions and Discussions

    1. Saving current date and time in ASP and ACCESS
      Hi all, Im developing a simple web page and Im new to ASP. I want to save the current date and time in my MS ACCESS table I have a field in...
    2. Current Time
      I need to show a current time in this mode ( 29.3 secondes ) how i do ?? I use this for show current time in this mode ( 29340 ) i don't know...
    3. Current time in a procedure ??!!
      Hi, i want to put a lot of trace (log time in a table) in some procedure. The function "current" show the same time by statement. How can i get...
    4. How to change the current thread current culture at run time.
      I have created a new culture : Dim objCulture As New CultureInfo("he") //hebrew When I tried to assign it to the current thread. ...
    5. Current Date & Time
      I want to display the current date & time on my web site. Not being a code guru could someone please tell me what is the simplest script that works...
  3. #2

    Default Re: Outputting current time

    the simplest way is to simply dateAdd("h",10,now()) BUT that doesn't take into account daylight savings, etc. you might have a look at [url]http://www.sustainablegis.com/projects/tz/testTZCFC.cfm[/url].

    PaulH Guest

  4. #3

    Default Re: Outputting current time

    I always use the following function in my Application.cfm

    <cfscript>
    // allow for time difference
    REQUEST.DateTime = DateAdd("h", GetTimeZoneInfo().utcHourOffset, Now());
    </cfscript>

    Then I reference REQUEST.DateTime instad of Now() throughout the Application.
    Gives the difference between the server time and the time in Greenwich London,
    so if you add or subtract the relevant number of hours that should sort it!

    Stressed_Simon Guest

  5. #4

    Default Re: Outputting current time

    i probably spend too much time thinking about timezones and calendars and such
    but that's not a good idea, not all tz offsets are in hours. historically
    there have been pretty "interesting" tz (for instance Asia/Riyadh87 &
    Mideast/Riyadh89 have an offste of GMT+03:07) since these are in the hands of
    politicians. so you need to be careful about this sort of thing. further,
    you're not taking into account DST which isn't even uniform within some
    countries let alone across them.

    PaulH Guest

  6. #5

    Default Re: Outputting current time

    Thanks for the responses guys. Knew someone else would have the same issue.


    "PaulH" <paul@sustainablegis.com> wrote in message
    news:d456bq$6l7$1@forums.macromedia.com...
    > i probably spend too much time thinking about timezones and calendars and
    such
    > but that's not a good idea, not all tz offsets are in hours. historically
    > there have been pretty "interesting" tz (for instance Asia/Riyadh87 &
    > Mideast/Riyadh89 have an offste of GMT+03:07) since these are in the hands
    of
    > politicians. so you need to be careful about this sort of thing. further,
    > you're not taking into account DST which isn't even uniform within some
    > countries let alone across them.
    >

    bj Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139