Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...CurrentDate - is what date?CurrentDate - is what date?
Previous
 
Next
New Post
4/12/2006 3:33 PM
 

IMHO for display of current and historical times we cannot use a single algorithm - the solution depends on the context. Displaying the date/time of a post in a forum should be converted to the viewing user's local time, but the time on a schedule e.g. for San Francisco Bay Area Ferries needs always to be displayed in Pacific Time - or think of a transamerica train, that crosses multiple time zones borders. If we try to store generally in UTC, we sometimes might need to store the UTC offset as well to be able to display local time, if specified. Of cause, this is a task for the module used, but the framework should provide functions for calculation.

Just my 2 cents.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
4/12/2006 3:34 PM
 

The quick answer here is - it may work, but not always, and the reason is you are still pulling from the registry to get the machine date/time, which may not be correct if the registry #1 not keep current with changes, and #2 the date/time reference goes back further than the current year.  That may not be a big item for some, but for folks interested in keeping historical data like maybe physician offices where patient contact and information date/time is important, it is very important to know when something took place in relation to the date/time year of reference, and not the current year.

The original post was about the CurrentDate that's true enough, I somewhat hijacked it, because this question really emcompases so much more.  I remember expressing my misgivings about adding the routine to Core when it first was presented, citing the inaccuracies, but it went through anyway, and it's been an issue since it was release way back then.  Many won't see it, because you have to make some changes in the skin's date time formatting to notice it, but it's been an issue for a long time, and I did my best to offer the solution and to bring it to CT attention on their forum. 

At least that's the way I see it.  If you've got an example of such a javascript, I'd be willing to test it out, because if that fixes the issue for the more global solution, than I sure could use it.

 
New Post
4/12/2006 3:56 PM
 

 

I read those other thread yesterday, and I still don't understand why you would want to try and store what time zone (and if that time zone uses DST).

I know we offer that as a personalization feature now, but it sure seems like if you get the current date/time that the user has set and offset that from the server's current date/time, then you could apply that offset to any date/times that you rendered, and it would already have DST taken into account.

If you go to the link below, you can see what your local time zone offset is from GMT

http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_gettimezoneoffset

If you change the settings on your local machine so that it doesn't automatically adjust, you will get a different number in this page (if you are in a DST zone). 

For more details on how to implement this in ASP.Net, I found this post to present an acceptable solution.

http://www.dotnet247.com/247reference/msgs/37/188110.aspx

 

 


DotNetNuke Modules from Snapsis.com
 
New Post
4/12/2006 4:26 PM
 

To understand the issue fully, you have to understand what the registry is storing and how it is used.  Any javascript is pulling from the registry settings.  My review of those settings indicate that it is not always correct, due to the many geo-political differences around the globe, and has no historical reference.  For example, the states within AUS had to adjust their Summer Time transition date/times due to the Commonwealth Games this year, effectively extending Summer Time, not sure if all of them did, but I don't think all use Summer Time.  Now, a special update was available for those wishing to make the registry changes, but it was not offerred as an automatic update, if you are hosting AUS clients from the affected region, then you may not be showing the date/time properly or even storing it correctly.  To make matters more confusing, next year the settings go back to the previous settings.  Now, if you are keeping date/time info that is date/time sensistive for more than the current year, you need to worry about making some kind of adjustment for each year, not just the current year, which the machine setting in the registry is limited to.  The offset could change from year to year.

A good way to get an understanding of why this is important and so difficult to implement is to join the TZINFO mailing list, where the grandaddy of the TZ information is discussed.  The AUS change is just one of several that is affecting web sites this year, others are hitting too, and that mailing list is very good at alerting folks to the changes.  MS doesn't send out any notices for these kinds of issues that I know of, you have to search the KBs for mention of them.  If I'm wrong about this fact, feel free to enlighten me, I won't take offense, really.

As for the javascript examples, an example of using them in DNN is still needed, I still don't fully understand how to do that, and that's my bad, I know. 

I'm working on a solution, but it's slow going, as I've had numerous conversations with folks that provided solutions using Ruby and SmallTalk, and I've not been good at connecting the solutions to .Net.  Maybe others have that facility, and are already workinig on it.  Back to why store the tz and offset in the db, well, it's the only real way to know when a piece of data hit the db.  In using DST, there is a built-in abiguity when the transition falls back 1 hour.  Unless you store date/time in UTC, you would not be able to resolve the duplicate times for the hour that is repeated.  Not a big deal for most, but vital for others.  If you were unlucky enough to have a db in any area where Katrina hit, you probably had to move your db to another provider, and if you didn't have the ability to make adjustments on the server/machine for date/time, you would have found yourself in deep trouble to accurately retrieve information that was date/time sensitive.

It's ok to disagree, because I'm not trying to win converts, there are a lot of folks wanting a solution, not just for DNN but for other web apps as well.  DNN is my pet app, so that's what I'm working on, at a snails pace I admit.  Again, this is not really a skinning question, but a localization issue, however since it is seen in skins I just wanted folks to understand that it is a bigger issue.

I'll shut up now, and go back to what I'm being paid to do, but if you're interested we can discuss the issue in the localization forum, or you can always send me an email.  I'm a pretty easy going guy, so most always you'll get a friendly response, as I hope this is being taken as one too.

Cheers

 
New Post
4/13/2006 10:24 AM
 
The problem is that UTC offset is different, based on DST. For instance, that JavaScript says I'm UTC-5, but I'm -6 with DST. This calculates it correct now, but when the same logic is applied on the server, which knows I'm UTC-6 (based on my profile), I get the wrong time. This is the heart of the issue.

Phil is talking about how the DST rules change, so there needs to be a way to store the location's DST rules at the time the date was inserted into the database so that it can be rendered correctly when displayed.

Sebastian is right tho. These things need to be up to the developer to ensure only the correct formulas are applied. The only problem I see with that is that most people won't know about the problem and won't adjust for it. It'll be a growth thing, I guess. Not a big deal for most until they run into the problem.

Michael Flanakin | Microsoft Consulting Services
www.michaelflanakin.com
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...CurrentDate - is what date?CurrentDate - is what date?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out