473,396 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

UTC Time, but how?

Hello All,

In our project management software, we just noticed an issue. If team
members are across the world, then there is an issue with due dates
being consistent. (even though we have not yet had such customers, but
we want to address this)

For example.

A team is consists of 3 team members. John (U.S Eastern time), Jack
(U.S West), Kate (China, Beijing time)

Problem

- Web server and database servers are located in Virgina U.S (East
coast)

- John on U.S east cost assigned a task to Kate and Jack, with a Due
12/13/2007 7:00pm (U.S eastern time)

- To Kate in China, she should be seeing Due Date: 12/14/2007
8:00am (Beijing Time) (13 hours difference ahead )

- To Jack on U.S west coast, Due Date: 12/13/2007 4:00pm (3 hours
behind)
Our issue right now is that everyone see the due date as 12/13/2007
7:00pm, which Kate will finish early (that's good), but Jack will
finish 3 hours late... to John at least.
What is it that I have to do in

1) Our c# code
2) Database server
3) ASP.NET page which auto detects user's UICulture and CultureInfo

Basically, what is the process of going through saving to database,
retriving from database and then display the date time to a user
specifically to their time zone?

Any suggestions is greatly appreciate it. I'm still trying to read up
on UTC, a bit confused

Thanks
Dec 13 '07 #1
3 2341

"Liming" <lm********@gmail.comwrote in message
news:db**********************************@t1g2000p ra.googlegroups.com...
Basically, what is the process of going through saving to database,
retriving from database and then display the date time to a user
specifically to their time zone?

Any suggestions is greatly appreciate it. I'm still trying to read up
on UTC, a bit confused
I don't believe that TimeZone (in the context you are talking about) has
been implemented in .NET framework. So, you would have to assosiate your
specific time zone information with each user's profile, keep the time in
the database in UTC. Both saving and retrieving time will require
calculations bazed on user's time zone offset. (don't forget to factor DST
for both user and web server).

D.

Dec 13 '07 #2
the typical is to store the utc date in the database. then when you display
dates, you translate the date to the local to the local time zone. if you
are just using dates, and not times, then you need to decide the timespan a
univeral date represents.

if you say 12/21/2007, its it begin/end of day a for each timezone (thus
making the day really 48 hours long) or is there a fixed time (8:00pm pst).
once you decide this you can convert the date.

you next problem is getting the local timezone of the client. the browser
doesn't send it. you have two option, use javascript to convert the dates to
utc, or fill a hidden field with the current time and clac the timezone on
the server.

-- bruce (sqlwork.com)
"Liming" wrote:
Hello All,

In our project management software, we just noticed an issue. If team
members are across the world, then there is an issue with due dates
being consistent. (even though we have not yet had such customers, but
we want to address this)

For example.

A team is consists of 3 team members. John (U.S Eastern time), Jack
(U.S West), Kate (China, Beijing time)

Problem

- Web server and database servers are located in Virgina U.S (East
coast)

- John on U.S east cost assigned a task to Kate and Jack, with a Due
12/13/2007 7:00pm (U.S eastern time)

- To Kate in China, she should be seeing Due Date: 12/14/2007
8:00am (Beijing Time) (13 hours difference ahead )

- To Jack on U.S west coast, Due Date: 12/13/2007 4:00pm (3 hours
behind)
Our issue right now is that everyone see the due date as 12/13/2007
7:00pm, which Kate will finish early (that's good), but Jack will
finish 3 hours late... to John at least.
What is it that I have to do in

1) Our c# code
2) Database server
3) ASP.NET page which auto detects user's UICulture and CultureInfo

Basically, what is the process of going through saving to database,
retriving from database and then display the date time to a user
specifically to their time zone?

Any suggestions is greatly appreciate it. I'm still trying to read up
on UTC, a bit confused

Thanks
Dec 13 '07 #3
Thanks Dmitry and Bruce. Okay..from the sound of it, it's becoming a
lot more complicated than I thought... the picture is a bit more
clearer now, is the following process the right process from a web
application's perspective according to your description?

1) Ask the user to specify their timezone information when registered,
save it using ASP.NET Profile service (How do I find out all the
available time zone in the world? U.S Eastern, U.S Pacific, Beijing
China, Tokyo Japan, etc etc?)

2) Change all database scripts where I did getDate() to getutcdate()?

3) In our ASP.NET application, everywhere where we asked to input
"Due Date" (with date and (hours:minutes) ), in my back end c# data
access class, I have to convert that to UTC before saving to database?
or do I have to first calcuate their timezone offset && dst first
before convert to UTC? (any examples to point to? These information
are so rare on the web to my surprise after googling)

4) After saving to the database, when I retrieve from database and
display to the user, I convert UTC back to Local Time (server's time)
and then adjust it to user's time in their timezone saved in their
profile and if there is DST, adjust that as well?

Sorry if I'm asking these beginner questions. First time I need to
deal with an application across timezones.

Thanks again!
On Dec 13, 3:47 pm, bruce barker
<brucebar...@discussions.microsoft.comwrote:
the typical is to store the utc date in the database. then when you display
dates, you translate the date to the local to the local time zone. if you
are just using dates, and not times, then you need to decide the timespan a
univeral date represents.

if you say 12/21/2007, its it begin/end of day a for each timezone (thus
making the day really 48 hours long) or is there a fixed time (8:00pm pst).
once you decide this you can convert the date.

you next problem is getting the local timezone of the client. the browser
doesn't send it. you have two option, use javascript to convert the dates to
utc, or fill a hidden field with the current time and clac the timezone on
the server.

-- bruce (sqlwork.com)

"Liming" wrote:
Hello All,
In our project management software, we just noticed an issue. If team
members are across the world, then there is an issue with due dates
being consistent. (even though we have not yet had such customers, but
we want to address this)
For example.
A team is consists of 3 team members. John (U.S Eastern time), Jack
(U.S West), Kate (China, Beijing time)
Problem
- Web server and database servers are located in Virgina U.S (East
coast)
- John on U.S east cost assigned a task to Kate and Jack, with a Due
12/13/2007 7:00pm (U.S eastern time)
- To Kate in China, she should be seeing Due Date: 12/14/2007
8:00am (Beijing Time) (13 hours difference ahead )
- To Jack on U.S west coast, Due Date: 12/13/2007 4:00pm (3 hours
behind)
Our issue right now is that everyone see the due date as 12/13/2007
7:00pm, which Kate will finish early (that's good), but Jack will
finish 3 hours late... to John at least.
What is it that I have to do in
1) Our c# code
2) Database server
3) ASP.NET page which auto detects user's UICulture and CultureInfo
Basically, what is the process of going through saving to database,
retriving from database and then display the date time to a user
specifically to their time zone?
Any suggestions is greatly appreciate it. I'm still trying to read up
on UTC, a bit confused
Thanks
Dec 13 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bart Nessux | last post by:
am I doing this wrong: print (time.time() / 60) / 60 #time.time has been running for many hours if time.time() was (21600/60) then that would equal 360/60 which would be 6, but I'm not getting...
5
by: David Stockwell | last post by:
I'm sure this has been asked before, but I wasn't able to find it. First off I know u can't change a tuple but if I wanted to increment a time tuple by one day what is the standard method to do...
6
by: David Graham | last post by:
Hi I have asked this question in alt.php as the time() function as used in setcookie belongs to php - or does it belong equally in the javascript camp - bit confused about that. Anyway, can anyone...
3
by: Szabolcs Nagy | last post by:
I have to measure the time of a while loop, but with time.clock i always get 0.0s, although python manual sais: "this is the function to use for benchmarking Python or timing algorithms" So i...
6
by: Rebecca Smith | last post by:
Today’s question involves two time text boxes each set to a different time zone. Initially txtCurrentTime will be set to Pacific Time or system time. This will change with system time as we travel...
3
by: luscus | last post by:
Thanks for all the responses on my first question. Unfortunately the answers I was given were too complicated for my small brain , and neophite condition to understand. So if you could talk down to...
3
by: cj | last post by:
If I want to check to see if it's after "11:36 pm" what would I write? I'm sure it's easy but I'm getting tired of having to work with dates and times. Sometimes I just want time or date. And...
1
by: davelist | last post by:
I'm guessing there is an easy way to do this but I keep going around in circles in the documentation. I have a time stamp that looks like this (corresponding to UTC time): start_time =...
2
by: Roseanne | last post by:
We are experiencing very slow response time in our web app. We run IIS 6 - windows 2003. I ran iisstate. Here's what I got. Any ideas?? Opened log file 'F:\iisstate\output\IISState-812.log'...
9
by: Ron Adam | last post by:
I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but it's not always clear which, so I came up with the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.