Developer forum

Forum » Development » Date Formats

Reply
We had a strange situation where the Cache mechanism was not working properly.  Basically the cache files where being created with a dd/mm/yyyy format however when checkd for expiry these where threated as mm/dd/yyyy.  Now we know for sure that the caching mechanism is doing a specific date formating of dd-MM-yyyy when saving a file if the date is invalid however the same check is not applied when loading the expiry date from the file.

The solution to this was to change the short date format of the Network Service Account in the Registry so the account has a en-US locale with a dd/MM/yyyy short date format.

My question here is, Can anyone list the proper date formats /reginal settings/ whatever settings for the accounts used by Dynamicweb to avoid these complications ?  For sure Dynamic web does not seem to work with all formats cause we noticed specific format checks which would cause problems.  So it would be ideal if it is specified what regional settings need to be setup.

Any help or feedback on similar occurances is appreciated.

Thanks
Trevor

Replies

 
Nicolai Høeg Pedersen
Reply
Dynamicweb should be indifferent of server setup of date formats. If it is not it is a bug...

The cache files (/Files/Cache.net/) are written as yyyy-mm-dd to avoid problems with date format issues.

Dynamicweb should use that format allover.

 
Reply
I can assure you it's not using that format.  The expiry date is written at the start of the file like so <!--11-08-2010 10:28-->  and this expiry date was writtent recently as you can see using dd-MM-yyyy however when it is being compared a MM-dd-yyyy format is being used.  in fact we shifted the server date in future in november and the file then got overwritten properly.

I did open a case but it was quickly discarded as an out of hosting issue. 
To satisfy our curiosity we quickly debugged and identified the code which might need a tweak.

From experience I can tell that Date formats can be a night mare and my rule is either handle them everwhere or else use the platform formats all over.  As soon as you have one instance where you are checking for a specific format then you've might run into trouble.

This should explain something to whom it may concern.

  CacheExpires = Dates.ShowDate(DateAndTime.DateAdd(DateInterval.Minute, 1440.0, DateAndTime.Now), "dd-MM-yyyy", true, "hh:mm");
 
 
Nicolai Høeg Pedersen
Reply
Thanks for sharing.

Checked the code the other day and found the error you also located and made a change. Will be out with an upcoming release.

BR Nicolai
 
Reply
Thanks Nicolai.  That's good news we really Appreciate it.

 

You must be logged in to post in the forum