Get Time Snippets


21 January, 2011   

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.

22 June, 2014   

To test in other timezones, replace '-5' with your local standard time GMT offset.

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.

30 March, 2011   

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...

23 January, 2013   

Adjusted for daylight saving or standard time as appropriate.

04 May, 2011   

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 when...

09 October, 2011   

Example shows how to get the database date and time.

03 March, 2011   

Count Script Execution Time

28 October, 2013   

C code example how to measure time of execution

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.

22 November, 2011   

Check out the Time in the Status Line at the bottom left.

17 January, 2013   

Code snippet for showing number guessing game by C++ program

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

05 July, 2012   

Converts a date or time from one timezone to another.

10 October, 2012   

Converts a date or time from one timezone to another.

PHP code to convert MySQL date to UNIX timestamp

JavaScript code to get time intervals between two Dates

21 April, 2012   

Retrieves a list of "on call" incidents for the most recent time period. Selects all Support Analysts.

30 August, 2011   

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.

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"