All Entries Tagged With: "date"
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 use different date types .
public static string SQLDate(string date)
[...]
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
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′));
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 a literal to separate Date and time representation. Since there is no date/time data type [...]
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 described:
Key
Description
PHP
Date/Time
r
RFC 2822: D, d M Y H:i:s O
Date
Year
Y
Year as 4 digit number
y
Year mod 100 as 2 digit number
L
1 if [...]