Sorry if this was mentioned before... caught this thread part way
through...


I personally like to store the UTC in the database using either
ColdFusion's functions or by using the getutcdate() function as a
default field in SQL server.


I then use _javascript_ when the person logs in to find the time zone
offset of THEIR computer.  Set that in a variable and use it to display
the proper date/time in my output.  Works very well...


One thing to keep in mind... when doing reports, queries, etc... you'll
want to adjust the date/time in your queries in order to get accurate
output.


-Novak

-----Original Message-----
From: Mark Leder [mailto:[EMAIL PROTECTED]
Sent: Friday, July 02, 2004 9:41 AM
To: CF-Talk
Subject: RE: Posting to db as GMT date/time

Thanks for your insight.

Thanks, Mark

  _____  

From: Ian Potts [mailto:[EMAIL PROTECTED]
Sent: Friday, July 02, 2004 11:47 AM
To: CF-Talk
Subject: Re: Posting to db as GMT date/time

Sounds like a solid plan to me. Adjust to GMT on insert, display in
whatever timezone you like. I believe the function GetTimeZoneInfo()
will return a struct with the server's offset info.

1) Convert the date from whatever timezone to GMT (use the server's
offset).
2) Display using the offset for EST (GMT -5), or whatever timezone you
choose

Example:
PST is -8 hours behind GMT. Say you have a date of 7/2/04 4:00pm PST
to insert. You'd insert it as 7/3/04 00:00am (7/2/04 4:00pm + 8 hours)
and when you pull it out of the db and want to display it in say EST,
you would subtract 5 hours and get 7/2/04 7:00PM

----- Original Message -----
From: Mark Leder <[EMAIL PROTECTED]>
Date: Fri, 2 Jul 2004 11:22:46 -0400
Subject: Posting to db as GMT date/time
To: CF-Talk <[EMAIL PROTECTED]>

Hi all,
I have a forum app which is hosted in Arizona, but almost all users are
here
in Ohio.  When a message is posted or replied to, I use
#CreateODBCDate(Now())# which inserts the post to Arizona Time (theire
time
zone doesn't seem to follow anyone elses).  I'm thinking that a better
solution might be to post to GMT 0 time, then on db query and display,
call
the local time zone in Ohio time (EDT).

Two issues:
1) How do I code the date as GMT for insertion to SQL 2000
2) How to I create the time difference for Ohio?

I'm using CFMX 6.1 with Win 2003.

Thanks, Mark________________________________
  _____
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to