Time From Now

Developer

jbueler - jbueler

3rd Party (Free)

338 downloads (last 90 days)

Download v1.0

EE Version Support

  • ExpressionEngine 2

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.

  • Updater
  • Multi Site Manager
  • Stand Alone Entry Form
  • Low Variables
  • Content Elements
  • Better Workflow
  • Matrix
  • Grid
  • Webservice
  • Publisher

Requirements

  • jQuery for the Control Panel

Add-On Type(s)

Plugin

Tags

Time from now will let you add a string modifier to the current time and will return a datetime string in its place. This would be useful for performing channel entries loops with the start_on and stop_before parameters. This will let you use dynamic dates in situations where you may have had to enable PHP before.

Time From Now

Time from now will let you add a string modifier to the current time and will return a datetime string in it’s place. This would be useful for performing channel entries loops with the `start_on` and `stop_before` parameters.

This will let you use dynamic dates in [situations where you may have had to enable PHP before.](http://ellislab.com/expressionengine/user-guide/add-ons/channel/channel_entries.html#start-on)

	{exp:channel:entries
		channel="value"
		dynamic="no"
		start_on="{exp:time_from_now modifier="-7 days"}"
		stop_before="{exp:time_from_now modifier="+7 days"}"
		show_future_entries="yes"
		parse="inward"}
		
		{title}
		
		{if no_results}{redirect="404"}{/if}
	{/exp:channel:entries}

### Parameters
#### modifier
Takes a string description of the desired time period you want the tag to return. Examples:

1 hour ago

	{exp:time_from_now modifier="-1 hour"}

15 minutes ago

{exp:time_from_now modifier="-15 minutes"}

2 days from now

{exp:time_from_now modifier="+2 days"}

More information on modifier strings can be found in the PHP docs for [strtotime](http://us2.php.net/strtotime) any string that `strtotime` can take you can use as the modifier.

#### format
optional format string to change the datetime format returned. Default format is `%Y-%m-%d %H:%i`. Examples:

	{exp:time_from_now modifier="-8 years" format="%D, %F %d, %Y - %g:%i:%s"} 
	{!-- returns a date formated like this "Tue, May 16, 2006 - 10:23:45" --}

Date format strings should use the standard Date Variable Formating from the Expression Engine docs. You can find more examples in their docs [http://ellislab.com/expressionengine/user-guide/templates/date_variable_formatting.html](http://ellislab.com/expressionengine/user-guide/templates/date_variable_formatting.html)

 

Download Time From Now

EE Support Downloads Add-On Version Release Date
Not Specified Download 1.0 May 16, 2014

This entry was created May 16, 2014, 1:11 pm.
This entry was last updated May 16, 2014, 1:57 pm.

Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

Returns: devot:ee has a 30-day return policy on all commercial add-ons sold through devot-ee.com. If you need to return an add-on, do not go to the developer or the developer's site, but rather visit our returns page at https://devot-ee.com/returns to initiate your return. If you have questions, email support@devot-ee.com.

1 Review:

Lise Holliker Dykes 09.04.14

Lise Holliker Dykes
Rating - {addon_rating_average}

Simple, effective. Used with Low Search to do date ranges based on entry_date. Thanks!