Tag Archives: date

Extension of the Date class in Javascript

The prototype property can also be used to extend JavaScript classes. In the following code, ISLEAPYEAR function () is implemented. It determines if the return value of getFullYear () is a leap year. ISLEAPYEAR () becomes a method of the … Continue reading

Posted in Object oriented Javascript | Tagged | Leave a comment

Format a date passed as a string in C#

The following function formats a date passed as a string for you to be able to control the date type that you are familiar with. Dates sometimes can cause unnecessary errors that are quite hard to debug since different countries … Continue reading

Posted in C# ASP.NET | Tagged , | Leave a comment

Find date difference in MySQL

We can use MySQL datediff function to find the number of days between two dates. Prior to MySQL 4.1: SELECT TO_DAYS(’2010-11-08′) – TO_DAYS(’2010-07-26′); Output: 105 MySQL 4.1.1+: SELECT DATEDIFF(’2010-11-08′,’2010-07-26′); Output: 105

Posted in MYSQL Basics | Tagged , | Leave a comment

Find difference in dates in mysql

We can use the TIMEDIFF and TIME_TO_SEC functions to find the time difference in seconds. SELECT TIME_TO_SEC(TIMEDIFF(’2010-01-09 10:24:46′,’2010-01-09 10:23:46′));

Posted in MYSQL Basics | Tagged , | Leave a comment

XML-RPC Date/Time Data Type

An XML-RPC date/time data type is a primitive data type and specifies a date and a time value, up to the second. It follows the format YYYYMMDDTHH:MM:SS. using Year, month, day, hour, minute, and second conventions. The “T”, however, is … Continue reading

Posted in PHP XML | Tagged , , , | Leave a comment

PHP date function – Format a UNIX time as text

The date function formats a UNIX time integer as text according to a specially encoded format string. Syntax: string date (string $Format); string date (string $Format, int $Time); Arguments: $Format A format string; the following key characters are substituted as … Continue reading

Posted in PHP Date and Time | Tagged , , | Leave a comment