423,513 Members | 2,399 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,513 IT Pros & Developers. It's quick & easy.

Time zones and dates

P: n/a
Hi,

I'm busy implementing a PayPal solution at the moment, part of which
involves adding the PayPal transaction information to SQL Server for
fulfillment, stock management etc. PayPal provides an internal mechanism for
this, but supplies the date and time of the transaction in the following
format:

18:30:30 Jan 1, 2000 PST

Easy enough, of course, to strip off the Pacific Standard Time identifier
and convert the resulting string into a DateTime variable with
DateTime.Parse.

However, I'm in the UK, so need to record this information in UK time.

Again, easy enough to take the resulting DateTime and apply .AddHours(8) to
it, but this may not always be 100% accurate due to Daylight Savings in the
US and/or British Summer Time in the UK.

Is there anything in the Framework (customer is still on v1.1) which will
handle this, or would I need to maintain some sort of date lookup table
indicating when the time changes in the US and the UK?

Any assistance gratefully received.

Mark
Nov 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Mark,

Unfortunately, you will have to do this yourself, as you said, based on
the time zone indicator. .NET doesn't have a good story for this, I am
afraid.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:OG*************@TK2MSFTNGP10.phx.gbl...
Hi,

I'm busy implementing a PayPal solution at the moment, part of which
involves adding the PayPal transaction information to SQL Server for
fulfillment, stock management etc. PayPal provides an internal mechanism
for this, but supplies the date and time of the transaction in the
following format:

18:30:30 Jan 1, 2000 PST

Easy enough, of course, to strip off the Pacific Standard Time identifier
and convert the resulting string into a DateTime variable with
DateTime.Parse.

However, I'm in the UK, so need to record this information in UK time.

Again, easy enough to take the resulting DateTime and apply .AddHours(8)
to it, but this may not always be 100% accurate due to Daylight Savings in
the US and/or British Summer Time in the UK.

Is there anything in the Framework (customer is still on v1.1) which will
handle this, or would I need to maintain some sort of date lookup table
indicating when the time changes in the US and the UK?

Any assistance gratefully received.

Mark

Nov 17 '05 #2

P: n/a
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:OI**************@TK2MSFTNGP09.phx.gbl...
Unfortunately, you will have to do this yourself, as you said, based on
the time zone indicator. .NET doesn't have a good story for this, I am
afraid.


I had a feeling that this was the case...

I've had a bit a trawl round Google and the "usual" code sites, and there
isn't really anything out there, which is slightly surprising, as someone
must have encountered this situation before now...

I've posted a message on PayPal's own developer forum, because PayPal
themselves report the time of the transaction correctly in their payment
notification emails. That is, no matter where the seller and buyer are in
the world, they both receive payment notification emails showing the correct
time of the transaction in their respective time zones...
Nov 17 '05 #3

P: n/a
>> Unfortunately, you will have to do this yourself, as you said, based on
the time zone indicator. .NET doesn't have a good story for this, I am
afraid.


I had a feeling that this was the case...


You might want to check out:

World Clock and the TimeZoneInformation class
http://www.codeproject.com/dotnet/WorldClock.asp

Marc
Nov 17 '05 #4

P: n/a
"Marc Scheuner [MVP ADSI]" <m.********@inova.SPAMBEGONE.ch> wrote in message
news:l6********************************@4ax.com...
You might want to check out:

World Clock and the TimeZoneInformation class
http://www.codeproject.com/dotnet/WorldClock.asp


Thanks very much for that - looks pretty good. As far as I can tell, the US
& the UK change their time pretty much on the same day each year, but that
looks set to change in the US when daylight savings is scheduled to run from
March till November due to some new law...
Nov 17 '05 #5

P: n/a
"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
World Clock and the TimeZoneInformation class
http://www.codeproject.com/dotnet/WorldClock.asp


Thanks very much for that - looks pretty good.


Unfortunately, on closer inspection, it doesn't get me any further forward
at all - there's even a comment in the code saying that the results might be
false due to daylight savings...
Nov 17 '05 #6

P: n/a
> this, but supplies the date and time of the transaction in the following
format:
18:30:30 Jan 1, 2000 PST


I find it hard to believe that they are doing so, they should be using an
ISO8601 format and probably are. What sort of form does the data come in?
(Email, FTP, etc.)
Jan 12 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.