From 4b9c62980599228f070b401c7673dce8085b0c61 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 1 Jul 2011 17:40:48 -0500 Subject: backed out 648b42a75739, which was a NON-trivial whitespace commit. It broke the Typography class's string replacements, for instance --- user_guide/helpers/date_helper.html | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'user_guide/helpers/date_helper.html') diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index a2933420c..44096ff46 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -72,7 +72,7 @@ Date Helper

now()

Returns the current time as a Unix timestamp, referenced either to your server's local time or GMT, based on the "time reference" -setting in your config file. If you do not intend to set your master time reference to GMT (which you'll typically do if you +setting in your config file. If you do not intend to set your master time reference to GMT (which you'll typically do if you run a site that lets each user set their own timezone settings) there is no benefit to using this function over PHP's time() function.

@@ -82,10 +82,10 @@ run a site that lets each user set their own timezone settings) there is no bene

mdate()

This function is identical to PHPs date() function, except that it lets you -use MySQL style date codes, where each code letter is preceded with a percent sign: %Y %m %d etc.

+use MySQL style date codes, where each code letter is preceded with a percent sign: %Y %m %d etc.

The benefit of doing dates this way is that you don't have to worry about escaping any characters that -are not date codes, as you would normally have to do with the date() function. Example:

+are not date codes, as you would normally have to do with the date() function. Example:

$datestring = "Year: %Y Month: %m Day: %d - %h:%i %a";
$time = time();
@@ -149,7 +149,7 @@ echo standard_date($format, $time); DATE_RFC1123 RFC 1123 - Sun, 14 Aug 2005 16:13:03 UTC + Sun, 14 Aug 2005 16:13:03 UTC DATE_RFC2822 @@ -170,7 +170,7 @@ echo standard_date($format, $time);

local_to_gmt()

-

Takes a Unix timestamp as input and returns it as GMT. Example:

+

Takes a Unix timestamp as input and returns it as GMT. Example:

$now = time();

@@ -180,11 +180,11 @@ $gmt = local_to_gmt($now);

gmt_to_local()

Takes a Unix timestamp (referenced to GMT) as input, and converts it to a localized timestamp based on the -timezone and Daylight Saving time submitted. Example:

+timezone and Daylight Saving time submitted. Example:

$timestamp = '1140153693';
-$timezone = 'UM8';
+$timezone = 'UM8';
$daylight_saving = TRUE;

echo gmt_to_local($timestamp, $timezone, $daylight_saving);
@@ -208,7 +208,7 @@ $unix = mysql_to_unix($mysql);

This can be useful if you need to display a date in a form field for submission.

-

The time can be formatted with or without seconds, and it can be set to European or US format. If only +

The time can be formatted with or without seconds, and it can be set to European or US format. If only the timestamp is submitted it will return the time without seconds formatted for the U.S. Examples:

$now = time();
@@ -222,9 +222,9 @@ echo unix_to_human($now, TRUE, 'eu'); // Euro time with seconds

human_to_unix()

-

The opposite of the above function. Takes a "human" time as input and returns it as Unix. This function is -useful if you accept "human" formatted dates submitted via a form. Returns FALSE (boolean) if -the date string passed to it is not formatted as indicated above. Example:

+

The opposite of the above function. Takes a "human" time as input and returns it as Unix. This function is +useful if you accept "human" formatted dates submitted via a form. Returns FALSE (boolean) if +the date string passed to it is not formatted as indicated above. Example:

$now = time();

@@ -242,9 +242,9 @@ $unix = human_to_unix($human);
1 Year, 10 Months, 2 Weeks, 5 Days, 10 Hours, 16 Minutes -

The first parameter must contain a Unix timestamp. The second parameter must contain a -timestamp that is greater that the first timestamp. If the second parameter empty, the current time will be used. The most common purpose -for this function is to show how much time has elapsed from some point in time in the past to now. Example:

+

The first parameter must contain a Unix timestamp. The second parameter must contain a +timestamp that is greater that the first timestamp. If the second parameter empty, the current time will be used. The most common purpose +for this function is to show how much time has elapsed from some point in time in the past to now. Example:

$post_date = '1079621429';
$now = time();
@@ -256,7 +256,7 @@ echo timespan($post_date, $now);

days_in_month()

-

Returns the number of days in a given month/year. Takes leap years into account. Example:

+

Returns the number of days in a given month/year. Takes leap years into account. Example:

echo days_in_month(06, 2005);

If the second parameter is empty, the current year will be used.

@@ -304,7 +304,7 @@ echo timespan($post_date, $now);

This menu is useful if you run a membership site in which your users are allowed to set their local timezone value.

-

The first parameter lets you set the "selected" state of the menu. For example, to set Pacific time as the default you will do this:

+

The first parameter lets you set the "selected" state of the menu. For example, to set Pacific time as the default you will do this:

echo timezone_menu('UM8'); -- cgit v1.2.3-24-g4f1b