Thursday, March 29, 2012
Offset from GMT
from Active Directory. I want to present current dates and times to the
users in cases where the raw date/time is in GMT. Since the GMT offset
changes depending on the time of year, the program would need to change
twice a year. If I can determine the current offset from GMT from the
system, then I wouldn't have to change the program. I know that the system
knows the offset since it records the dates in GMT. Is it an easy value to
obtain from the system? My .Net skills are quite rudimentary. Thanks for
any help or references.You can use the DataTime.ToUniversalTime() method to set any local DateTime
to GMT. Similarly, you can find the offset of local time to GMT by
subtracting the local time from the local time as GMT, using the same
method.
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Hard work is a medication for which
there is no placebo.
"Rich Raffenetti" <raffenetti@.comcast.net> wrote in message
news:O6NzDT0YGHA.3880@.TK2MSFTNGP04.phx.gbl...
>I have an asp.net application that presents some user account information
>from Active Directory. I want to present current dates and times to the
>users in cases where the raw date/time is in GMT. Since the GMT offset
>changes depending on the time of year, the program would need to change
>twice a year. If I can determine the current offset from GMT from the
>system, then I wouldn't have to change the program. I know that the system
>knows the offset since it records the dates in GMT. Is it an easy value to
>obtain from the system? My .Net skills are quite rudimentary. Thanks for
>any help or references.
>
Offset from GMT
from Active Directory. I want to present current dates and times to the
users in cases where the raw date/time is in GMT. Since the GMT offset
changes depending on the time of year, the program would need to change
twice a year. If I can determine the current offset from GMT from the
system, then I wouldn't have to change the program. I know that the system
knows the offset since it records the dates in GMT. Is it an easy value to
obtain from the system? My .Net skills are quite rudimentary. Thanks for
any help or references.You can use the DataTime.ToUniversalTime() method to set any local DateTime
to GMT. Similarly, you can find the offset of local time to GMT by
subtracting the local time from the local time as GMT, using the same
method.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Hard work is a medication for which
there is no placebo.
"Rich Raffenetti" <raffenetti@.comcast.net> wrote in message
news:O6NzDT0YGHA.3880@.TK2MSFTNGP04.phx.gbl...
>I have an asp.net application that presents some user account information
>from Active Directory. I want to present current dates and times to the
>users in cases where the raw date/time is in GMT. Since the GMT offset
>changes depending on the time of year, the program would need to change
>twice a year. If I can determine the current offset from GMT from the
>system, then I wouldn't have to change the program. I know that the system
>knows the offset since it records the dates in GMT. Is it an easy value to
>obtain from the system? My .Net skills are quite rudimentary. Thanks for
>any help or references.
Monday, March 26, 2012
Okay to Exclude both Name and ID?
which presents read-only data in DIVs.
Just wondering if it's okay to omit both the Name and Id attribute of the
DIV tags in the table - or if there is some good reason why I should go to
the effort to create a unique Name or Id value for each (which would also
increase processing time and render more verbose html). Given that I have no
client- nor server-side code that references the DIVs, I might as well keep
things simpler. But my concern is that there might be some "gotcha" lurking
if I do this... perhaps some browsers wouldn't like it... Any thoughts on
this?
Thanks.Good question, GMan,
The ID is used to get a handle on Controls that you need to work with. The
Name attribute is for the client. So, assuming that you don't need to
manipulate your Controls on either server or client-side, you would have no
other need for these properties to be set.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"Guadala Harry" <GMan@.NoSpam.com> wrote in message
news:u32iwX5uEHA.1300@.TK2MSFTNGP14.phx.gbl...
> I'm dynamically building an HTML <table> that has a bunch of rows - each
of
> which presents read-only data in DIVs.
> Just wondering if it's okay to omit both the Name and Id attribute of the
> DIV tags in the table - or if there is some good reason why I should go to
> the effort to create a unique Name or Id value for each (which would also
> increase processing time and render more verbose html). Given that I have
no
> client- nor server-side code that references the DIVs, I might as well
keep
> things simpler. But my concern is that there might be some "gotcha"
lurking
> if I do this... perhaps some browsers wouldn't like it... Any thoughts on
> this?
> Thanks.
>
div's do not support a name attribute. the id attribute is optional, but if
used should be unique and follow the w3c naming conventions (asp.net breaks
this rule).
-- bruce (sqlwork.com)
"Guadala Harry" <GMan@.NoSpam.com> wrote in message
news:u32iwX5uEHA.1300@.TK2MSFTNGP14.phx.gbl...
> I'm dynamically building an HTML <table> that has a bunch of rows - each
of
> which presents read-only data in DIVs.
> Just wondering if it's okay to omit both the Name and Id attribute of the
> DIV tags in the table - or if there is some good reason why I should go to
> the effort to create a unique Name or Id value for each (which would also
> increase processing time and render more verbose html). Given that I have
no
> client- nor server-side code that references the DIVs, I might as well
keep
> things simpler. But my concern is that there might be some "gotcha"
lurking
> if I do this... perhaps some browsers wouldn't like it... Any thoughts on
> this?
> Thanks.
>
Okay to Exclude both Name and ID?
which presents read-only data in DIVs.
Just wondering if it's okay to omit both the Name and Id attribute of the
DIV tags in the table - or if there is some good reason why I should go to
the effort to create a unique Name or Id value for each (which would also
increase processing time and render more verbose html). Given that I have no
client- nor server-side code that references the DIVs, I might as well keep
things simpler. But my concern is that there might be some "gotcha" lurking
if I do this... perhaps some browsers wouldn't like it... Any thoughts on
this?
Thanks.Good question, GMan,
The ID is used to get a handle on Controls that you need to work with. The
Name attribute is for the client. So, assuming that you don't need to
manipulate your Controls on either server or client-side, you would have no
other need for these properties to be set.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"Guadala Harry" <GMan@.NoSpam.com> wrote in message
news:u32iwX5uEHA.1300@.TK2MSFTNGP14.phx.gbl...
> I'm dynamically building an HTML <table> that has a bunch of rows - each
of
> which presents read-only data in DIVs.
> Just wondering if it's okay to omit both the Name and Id attribute of the
> DIV tags in the table - or if there is some good reason why I should go to
> the effort to create a unique Name or Id value for each (which would also
> increase processing time and render more verbose html). Given that I have
no
> client- nor server-side code that references the DIVs, I might as well
keep
> things simpler. But my concern is that there might be some "gotcha"
lurking
> if I do this... perhaps some browsers wouldn't like it... Any thoughts on
> this?
> Thanks.
div's do not support a name attribute. the id attribute is optional, but if
used should be unique and follow the w3c naming conventions (asp.net breaks
this rule).
-- bruce (sqlwork.com)
"Guadala Harry" <GMan@.NoSpam.com> wrote in message
news:u32iwX5uEHA.1300@.TK2MSFTNGP14.phx.gbl...
> I'm dynamically building an HTML <table> that has a bunch of rows - each
of
> which presents read-only data in DIVs.
> Just wondering if it's okay to omit both the Name and Id attribute of the
> DIV tags in the table - or if there is some good reason why I should go to
> the effort to create a unique Name or Id value for each (which would also
> increase processing time and render more verbose html). Given that I have
no
> client- nor server-side code that references the DIVs, I might as well
keep
> things simpler. But my concern is that there might be some "gotcha"
lurking
> if I do this... perhaps some browsers wouldn't like it... Any thoughts on
> this?
> Thanks.