Timezone / now() function

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

  1. #1

    Default Timezone / now() function

    I looked for an answer to this problem for days !!!

    We have a shared hosting server that is in Australia that contains
    applications used by Australian users, however some of the applications are
    specific to Hong Knog (accessed by Hong Kong users from Hong Knog) The problem
    is that the application uses now() function which gets the date/time in
    Australia (where the server is) . How can we make this one application use the
    Hong Kong timezone but keep all other applications on the same server use
    Australian Timezone ?

    We basically eed to control the value of Now() at application level and not at
    server level. Is this possible ?

    Thanks

    Zach_Stone Guest

  2. Similar Questions and Discussions

    1. support for timezone / DST
      I'm new to Flex, have a simple question that I haven't been able to find the answer for: Given a future date and timezone indicator (e.g. "May...
    2. Timezone update package
      Is there an updated timezone information package available for Ubuntu 5.10 "Breezy Badger"? I'm personally interested in updates for Australian...
    3. Converting the time from one timezone to another
      I asked a question about a week ago about how to get my local time, since my application is running on a server halfway around the world. I have...
    4. timezone in javascript
      Hi! I have a javascript serverside script that stores the "Date" command in a database. The problem is that I am in Norway, ans the server is in...
    5. Timezone with MSSQL/IIS/ASP
      My WEB-server/MSSQL-server is in a different timezone (GMT -05:00). I need to publish records restricted to "today" according to my timezone (GMT +...
  3. #2

    Default Re: Timezone / now() function

    switch from now() to a var that contains the hong kong tz datetime which you can cast from the server's tz. maybe [url]http://www.sustainablegis.com/projects/tz/testTZCFC.cfm[/url] might help.

    PaulH Guest

  4. #3

    Default Re: Timezone / now() function

    Thanks for your reply Paul,

    If I do this will I still be able to use the now() variable ?

    We've got thousands of lines of code that are using now() so would be great if
    we can keep the var now() the same and just change its value to the new
    timezone !

    Zach_Stone Guest

  5. #4

    Default Re: Timezone / now() function

    sorry no. the now() function returns the datetime from the cf server. you'll
    need to set the hong kong now say in the application.cfm (or application.cfc)
    and use that in place of the now() function. it should be simple enough to do
    a search and replace.

    it would probably be a good idea to review all your apps for this kind of
    problem going forward. for example, how are you handling australia's 3 tz? we
    normally use UTC (GMT) for all datetimes and cast to the user's tz as required
    (that's where the timeZone.cfc came from in the first place).

    PaulH 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