• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How can I set the timezone in my application?

New Here ,
Mar 04, 2013 Mar 04, 2013

Copy link to clipboard

Copied

I inherited a website in which the DateFormat() function is littered throughout, and plays an integral role in ensuring the application runs correctly. For instance, we have a calendar system in which employees can book lessons on certain days and at certain times. The Date and Time functions are key to this application's success.

But we moved the website from one server to a newer, shared, one a few months back running CF10 on Windows Server 2008. (I believe the old one was running CF8 on a Windows 2000 server or something.) But what appears to be happening is that other users on this new shared box are changing the date/time based on their needs and at different times, and it is affecting our applications. I called the support staff of the hosting company who told me I had to specify the date and time via Java in my application file and that should solve the problem.

The issue is that I really have no idea how to do this. My programming with Java is virtually null, and even my familiarity with ColdFusion is waning, as I have not seriously used it in about 9 years. I see there are a number of tutorials and demonstrations on the web for accessing date and time via Java in ColdFusion, but I don't know how to set the application to a specified timezone, (which is what I think I have to do), so that when the DateFormat() object is called, it calls the correct date. Otherwise, when employees go to book lessons, the dates are off. Their calendar will show that April might begin on a Tuesday instead of a Monday. At other times we've noticed the hour is off by a considerable amount - 4 or 5 hours, when the server itself is in a timezone only 1 hour behind us.

Any idea how to pull something like this off?

I figure even if I can specify the timezone in the application files I may have to overwrite every instance of DateFormat() to something customized, but I'm hoping I don't have to go that far.

Any help is greatly appreciated.

Views

437

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 05, 2013 Mar 05, 2013

Copy link to clipboard

Copied

LATEST

Question: Do you think the response from the support staff is correct? I mean, surely, I can't be the only CF user on a shared box whose other users need to modify the date and time within their applications. Even if they do it at the application level for their domain, surely it wouldn't affect mine, would it? That was what was implied by the support people, but I have a feeling they are way off, or covering for some goof-up on their end. I struggled like hell yesterday trying to get this to work and I did not get very far at all.

I found an interesting tutorial here which does a comparison of time zones and, theoretically, this might do the trick. But if what the guy told me was nonsense then I won't bother with it. For the record, our calendar has been working fine for about a week now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation