Jonathan said:
No, I did not. In fact, I recall specifically stating that I was willing
to look at any other option that could be efficient done from where I
was starting--which has now been described in detail several times.
From your previous post: "Why/how does TimeZoneInfo address my needs.
Given the data I have, I couldn't really see." In other words,
TimeZoneInfo doesn't (according to you) address your needs.
I am trying to explain to you that you have not yet sufficiently
explained your needs. So we are left trying to figure out exactly what
your needs are. One way of doing that is pointing to a specific
solution and asking why that solution _does not_ address your needs.
You say you've looked at TimeZoneInfo and "couldn't really see" how it
addresses your needs. But that necessarily implies that you have
specific reason to believe it does _not_ address your needs.
It's not like I'm asking why the RichTextBox control doesn't address
your time zone-related calculation needs. That's trivially not
addressing your needs, and we'd get no information from hearing why it
doesn't address your needs.
I'm talking about a class specifically designed to deal with time-zone
issues. Inasmuch as the TimeZoneInfo class does address a number of
time-zone issues, by explaining why none of those features solve your
particular problem you can shed light on what your particular problem _is_.
You said a check box to say if it was DST at that particular time. Since
they could log on at different times, I don't see how this could be of
any value at all unless they have to keep checking it each time.
A check box that indicates whether the times should be adjusted for DST
has the same value that, for example, an edit field that indicates the
user handle that should be displayed with messages, or that allows the
user to enter a new password, or any profile setting that allows the
user to set any other persistent state for that user's profile.
In other words: the user sets the checkbox as desired, and from that
point on until the user changes it, times are displayed to the user
using the DST adjustment indicated (i.e. either adjusted or not).
It may well be that this has nothing to do with your particular problem.
But since we still don't know what your particular problem is, all I
can do is guess and offer information that _might_ help.
If you don't think it's helpful, that's fine. But debating whether the
general feature is useful is pointless. It obviously is, because it's a
common enough feature to find on web sites.
Where have I said either of those things?
See above for my detailed explanation of how you told us that
TimeZoneInfo doesn't address your needs. As for DateTime, you explained
in your first post that you're using the DateTime struct; the mere fact
that you're even asking the question indicates that the DateTime struct
also doesn't address your needs.
I don't recall you saying that,
I wrote: "The obvious solution is to add the offset to your UTC time,
and one more hour if the daylight saving time is set. The DateTime
class alone is sufficient for accomplishing that much".
but I don't know how to do that.
Have you looked at the documentation for the System.DateTime struct? It
provides everything anyone would need to understand how to do math
related to the DateTime struct. Including adding hours to a given
DateTime value.
For your convenience:
http://msdn.microsoft.com/en-us/library/system.datetime.aspx
In fact, I'm not sure I've seen anything related to DST in DateTime.
There's not anything related to DST in DateTime. But there's nothing in
your post that suggests that "DST" is anything more than "optionally add
an extra hour". The DateTime struct doesn't need to know anything about
DST for you to add an extra hour to it.
So if
it does this just fine, then this is simply information you are
withholding while you continue to tell me to provide more details
I'm not withholding any information at all. And how I could "withhold
information" AND simultaneously "provide more details" is beyond me.
That sounds like a logical impossibility to me.
and accuse me of saying this class won't work.
I haven't "accused" you of anything. I've simply stated facts, readily
evident by the text found in this thread.
It's not clear to me why you can't accept the question I asked is the
one I'm trying to get answered.
Because so far, you haven't asked a question that can be answered.
Pete