Changing the date on my web server stops my ASP.NET app from working - asp.net

I'm trying to write some code that checks the number of days between two dates, when I set the date on my IIS7 server to anytime in the future I get the standard "Internet Explorer cannot display the webpage" screen. This happens if I comment out all my date checking code, with todays date it loads with any future date it doesn't. I've tried rerunning IISReset which makes no difference.
Anyone seen this before?
Thanks
Jamie

You've proven that you can retreive the current system date from the server.
IMO, now you can go ahead and fudge the numbers by reading test dates from a file (override.txt, or whatever) and test your date calculation scenarios without having to mess with the server.
You will want to make sure that you have a common function for getting the system date, so that you can override in one spot. So if you're not already set to do that, re-tool the code a bit, re-test to ensure that you get the system date properly. Then drop in your override file and test away.

Related

Updating an Apple Watch's complication's content at midnight

I've add my complication entries and this all seems to work well - each complication entry is scheduled for midnight.
I'm testing the time change by setting my Mac's date to the following day where I'm expecting my complication to update to the next entry.
However, it only updates the entry when I open and close my app. I'm expecting to see it automatically change like the other standard complications do. Is this some behaviour I need to go out of my way to implement? I'd expect an automatic change as per the docs.
I've found the following:
ClockKit begins displaying a timeline entry precisely at the time specified by the entry’s date property.
But surely this is a greater than check too? I tried setting it exactly to midnight but (surprisingly) this doesn't work either.
Any help is appreciated.
Additionally, I found the following regarding updating the timeline, but I would have thought this would be for changing the timeline entries as oppose to just refreshing the complication for the current timeline:
During a background app refresh task. You can schedule background tasks to periodically update your watchOS content. This works best when your data changes at predictable times.
The Watch Simulator appears to have some quirks around handling of times. In particular, it doesn’t seem to obey time changes on the underlying system until you relaunch it.
Relaunch the Simulator after changing the system clock and check on your Complication then. If you want to test the transition to the next day specifically, you can set the system time to 11:58 pm and wait for it to cut over.

Classic asp code using more resources

I am using classic asp for a web application. I am running the web application on internet explorer.
I had developed few reports related to sales data. All the sales report are linked to Sales Dashboard. Every report has some selection criteria like customer selection date period selection product group selection and other few.
Now the problem which I am facing.
I open a total sales report for the entire year which takes almost 15 minutes to load on screen. while the report is executing if I try to open any other from the sales dashboard the page with selection criteria will appear after the first report is completely executed. If I copy the link location for the second report and open it in new window of internet explorer it will open normally.
I am not able to trace the problem did anyone had face the same problem.
First, I agree with this comment posted under the question:
IIS/ASP only allows one concurrent request per session. This is why the second request does not happen until after the first one completes. If you open a new browser instance or a different browser then this is treated as a different session.
Second, if all that is being asked here is whether other people have similar issues or not, then the answer is yes, due to what johna said in the comment.
If you're looking for a way to get around that for yourself, the way described in the comment (open a new browser instance or a different browser) will work.
However, if you're after a way to bypass the 15 minute wait time entirely, give some though to preparing the data before the report is called. What I mean by that is either schedule the report to run after close of business each day and store the relevant HTML or data separately, and/or provide a button to prepare the report based on current data which can be run whenever the user wants.

Angular uibDatePicker with JSON.NET and the inevitable time challenge

I want the user to enter dates, not times, just dates, using a datepicker. Doesn't seem too hard, but it's killing me.
I choose the 1st of December on the datepicker and click Save. In the Network tab on Chrome, I can see the data sent to the server has the value: 2015-11-30T22:00:00.000Z
On the server, while debugging I can see the value in the Date field is 30/11/2015 22:00:00.
This will then get stored in a Date column as 30 November 2015 and is wrong.
Where is the issue: the configuration of the angular directive, or the configuration of JSON.NET's deserialization? And how do I fix it?
Obviously quite a common question, I just needed to search a bit better.
In the end I've implemented this directive, which modifies the model used by the datepicker:
https://gist.github.com/weberste/354a3f0a9ea58e0ea0de

Dates are adjusted for users only at midnight on my xpages

We have a really strange problem in xpages regarding dates, the Notesdocument we have contain a date field and the value is only a date, there is no time portion.
In the xpage I have specified to display the date as a date/time value. the date display correctly on the webpage but we are now getting reports from users who login at night (around midnight) and see the date as adjusted by one day. if the same people login at daytime the date is correct so this only seem to happend around midnight
I have tried to change my clock on my client to around midnight but that does not reproduce it so I assume this is a server issue.
The domino server have correct date/time and we are using the latest version of Domino
any ideas?
we encountered the same problem recently and, I believe, found a very nice solution.
system treats the pure date as a date in UTC time zone. Date value is automatically converted into server's time zone. So the question is how to prevent conversion?
this code prevents conversion:
<xp:this.converter>
<xp:convertDateTime
type="date"
ignoreUserTimeZone="true"
dateStyle="long"
timeZone="UTC">
</xp:convertDateTime>
</xp:this.converter>
pay attention at "timeZone" attribute.
The issue is related to not having the TimeZone specified in the date / time field. We ran into this just yesterday. If you don't have the TZ specified, it seems to assume UTC and will adjust accordingly. Include the time zone and your field will stop adjusting erroneously.
Perhaps it has to do with this ?
http://www-304.ibm.com/support/docview.wss?uid=swg21508734
I've seen some reports about XPages Dates and TimeZone Issues
I suspect your Domino version was 8.5.3, because there were 2 APAR, LO72278 and LO67745, on similar problems against 8.5.3. Fixpack 3 addresses them.
The root cause is that Lotus Notes allows you to save a "Date" with no time or zone and the Notes server has a default Time Zone setting to interpret these incomplete things called dates. XPages doesn't play by the same rules, and its master Java wants to know what zone you're using, and looks to the system for some clue, and generally will use midnight within some TZ to refer to a "Date". There is a whole region on Stack Overflow on the "how to store/represent a date" topic - [datetime] - since languages and DBMS each have their own approach.
Nice legacy Notes focused article about it.
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/05022009100728PMAGU5MB.htm
XPages article about it
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/XPagesTimeZones.htm
Too bad they are not totally on the same page, I assume each release gets closer.

why does the date php and date unix does not match?

I have centos server and i rechanged the time to NewYork time by date cmd.
Also i change in php.ini the "date.timezone = "America/New_York""
When i enter the command date in the command shell. i get the real time in new york.
But when I do
echo date("Y-m-d H:i:s");
The time isn't right!
I always get 6 hours less then the time in New York.
Please help?
I tried already using date_default_timezone_set('America/New_York'); in the code with no help.
waiting for a response.
Thanks!
Koren Or
i rechanged the time to NewYork time by date cmd
The date command doesn't provide a means to change the timezone. You probably set it to the time that it is in new york time, but as whatever timezone it was already set to, so you ended up with the server time being six hours off (odd, it should be five off if it's UTC).
Set the TZ environment variable export TZ=America/New_York before setting the time with the date command. Having an incorrect server time can lead to serious problems.
You can initialize the timezone in your app. What happens when you do this?
date_default_timezone_set('America/New_York');
echo date("Y-m-d H:i:s");
i change in php.ini the "date.timezone = "America/New_York""
Look, it is very common fault of people who aren't familiar with a formal logic.
Let me show you using a little example:
Suppose you just put some money into your pocket.
I come across and asks you if you got any money in your pocket.
You says "Yes".
But you can't say it for sure!
You can tell for sure only that you put it there.
But there can be a hole in the pocket or some thief picked it already or you just confused pockets.
So, you have to check it first, and answer later.
Although it is negligible in the real world, in programming such a behavior become critical!
You can change whatever settings but you have to verify, if your actions had any effect
There can be an apache reload issue, or wrong ini.file or some runtime setting overwriting it.
Tl:dr
Always verify your settings, variables, data - if it really contains expected value!
Do not rely on the fact you changed it somewhere.
This sounds like an issue with not actually setting the timezone correctly on your machine.
First, to verify PHP is using the correct timezone, try the following to see.
echo date("Y-m-d H:i:s e");
That should give you "America/New York" if you have set it correctly in your script.
If so, I would try the procedure discussed here to change the time on your system and see if that works.
I'm just guessing here but do you restarted your apache server?

Resources