Sometimes the time set on your server isn't accurate to what your local time is. If you can't change it, you can adjust it yourself. If your server thought it was 12 midnight, but it was really 7 pm, this will roll the $today variable back five hours to be correct.
By default, Delphi gets its date/time, currency and numeric format from Control Panel's International settings. We can set the constants defined in Delphi, like DecimalSeparator, ShortDateFormat and others like in the code below. To a complete list of these variables, look at Currency and date/time formatting variables in Delphi Help.
Need to people out if they have been inactive for too long? Do it with this piece of code. This takes 3 functions to complete the inactive session task. 1. We need to check if the person is actually logged in using our isLogged function 2. We need the function to check the time the page loaded, and when the last page was loaded 3. We need a...
Adjusted for daylight saving or standard time as appropriate.
Need to people out if they have been inactive for too long? Do it with this piece of code. Introduction ----------------------- This takes 3 functions to complete the inactive session task. 1. We need to check if the person is actually logged in using our isLogged function 2. We need the function to check the time the page loaded, and...
Example shows how to get the database date and time.
Count Script Execution Time
When placed in startup scripts, this snippet activates every time user opens a file. It then traverses the directory path backwards and looks for user created project folders. If one is found, script offers to switch it on. This is very useful when working with a number of projects at a time.
Code snippet for showing number guessing game by C++ program
Check out the Time in the Status Line at the bottom left.
Converts a date or time from one timezone to another.
Converts a date or time from one timezone to another.
Scripts used to calculate Daylight Saving Time (DST) for the US and EU. Valid for years 1900 to 2099. [DST wasn't adopted until the 1950s-1960s for US and 1990s for the EU] By: brad degrandis
Retrieves a list of "on call" incidents for the most recent time period. Selects all Support Analysts.
JavaScript code to get time intervals between two Dates
This function returns the duration of the given time period in days, hours, minutes and seconds. For example: echo convertSecToStr('654321'); would return "7 days, 13 hours, 45 minutes, 21 seconds"
This snippet to show how to use the Last-Modified and the ETag header to optimize the caching of a website. If used correctly this will speed up your page loads.
Here shown how to highlight syntax
Code example to show current date and time
The example below defines a loop that starts with i=0. The loop will continue to run as long as i is less than, or equal to 5. i will increase by 1 each time the loop runs.