473,506 Members | 11,491 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DateTime and timezones question

Hey guys,

I need to compare two times that the user selects. The user selects the
hour, date, and timezone (which can be either NY, LN, or HK timezones).

How can I compare two dates of different timezones? For example:
Date1 = 11:30, 4/18/06, NY
Date2 = 16:30, 4/18/06, LN

These times should be considered equal (since of course LN time is +5 NY
time).

Any suggestions?
Apr 18 '06 #1
1 2122
Hi Flack,

you should convert the dates to UTC time and than you can compare the both.

Regards
--
Matthias Denkmaier
MVP, MCT, MCSD.NET, MCDBA
"Flack" wrote:
Hey guys, I need to compare two times that the user selects. The user selects the
hour, date, and timezone (which can be either NY, LN, or HK timezones).

How can I compare two dates of different timezones? For example:
Date1 = 11:30, 4/18/06, NY
Date2 = 16:30, 4/18/06, LN

These times should be considered equal (since of course LN time is +5 NY
time).

Any suggestions?

Apr 18 '06 #2

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

Similar topics

0
5087
by: Symon R | last post by:
This is a bit of a weird one that I haven't yet been able to solve - I'm hoping someone out there can disprove my findings and tell me where I've gone wrong! I have designed a web service that...
1
3785
by: James | last post by:
I need to import a bunch of data into our database for which there's a single entry each day which occurs at the same time every day in local time - so I need to convert this to UTC taking into...
2
14204
by: andrew lowe | last post by:
Hi, Please bear with me on this problem, first I'll give you some background: I have an object that contains a DateTime field which i pass to a webservice public class Foo { public DateTime...
2
1584
by: Navin Mishra | last post by:
Hi, Can a web service method return safely a DateTime value ? Would it cause problems for non-.NET client proxy generators ? Thanks Navin
9
2900
by: piersh | last post by:
Does anyone know how to make the following method work across timezones? public DateTime GetTime () { return DateTime.UtcNow; }
4
6388
by: Michael Meckelein | last post by:
Hello, Wondering, if C# (framework 2.0) does not support parsing DateTime timezones in three letter acronyms. I would like to parse date strings like "2005 Nov 01 11:58:47.490 CST -6:00" but...
2
3463
by: BLUE | last post by:
I want to store and retrieve datetime in ISO 8601 format: '2007-06-02T16:12:08.123-04:34' or '2007-06-02T16:12:08.123Z' When I insert a datetime with SQL Server Management Studio and then I...
9
9341
by: Abhishek | last post by:
Hi I am trying to deserialize/ Parse a datetime object with the below string "2007-05-14T08:00:00.000+02:30" . If i am in GMT + 2.30 time zone everything's fine however if i am in GMT + 5.30 i...
2
3509
by: Richard Rossel | last post by:
Hi friends, I need a little help here, I 'm stuck with epoch calculation issue. I have this datetime: date_new = datetime(*time.strptime('20080101T000000','%Y%m%dT%H%M%S') ) This date_new is in...
0
7220
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
7105
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
7308
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
7479
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...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
410
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.