Day or Night


No Two The Same

3rd Party (Commercial)
Current Version: 1.0
Minimum EE Version: 2.5.0
Release Date: Nov 21, 2014

License Agreement

Buy Now!


EE Version Support

  • ExpressionEngine 2


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


  • jQuery for the Control Panel

Add-On Type(s)



Find out if it's day or night where you are right now, next week or next month. Find out if it's night or day somewhere else and the time of sunrise or sunset.

I envisage Day or Night to be used in 2 ways. Changing website content based on the time of a known country or personalising a page for a customer based on their location. The first option is easier and the most accurate as you would supply the Latitude and Longitude.

{exp:day_or_night lat="40.7056308" lng="-73.9780035"}

You can supply a country code instead but this is approximate.

{exp:day_or_night country_code="GB"}

The simplest way to use Day or Night is by providing no parameters. This finds location information based on IP, so is only approximate.


The intended behaviour is to not fail. Day or Night will always return a result, even if it’s not what you were intending! First the IP is used to find a country, if this fails it defaults to date.default_latitude and date.default_longitude in php.ini. If this fails information for London UK is returned.

If not providing Latitude and Longitude the plugin finds an approximate location based on IP, this requires EEs built-in Addon, IP to Nation (not available in Core version). **Make sure to click, ‘Update IP Database’ to actually get the IP data!

If using the Country Code parameter, use the A2 (ISO) 2-letter standard. This method uses the centre of the country so might not be appropriate for large countries with multiple time-zones.


ExpressionEngine 2.5.5 or later
There’s no reason why this won’t work with earlier versions but not tested. Let me know if it does or doesn’t!

EE versions tested

  • 2.5.5
  • 2.7.3

Requires PHP 5 or greater.


  1. Place ‘day_or_night’ folder in to system/expressionengine/third_party/
  2. That’s it!



Full parameter list available in the docs.

Tag pairs


Full tag list available in the docs.

Single tags

Day or Night, Sunrise and Sunset are available as single tags, along with Is Day?, Is Night?


Day or Night Links

This entry was created November 20, 2014, 10:24 am.
This entry was last updated November 21, 2014, 6:39 am.

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 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 to initiate your return. If you have questions, email

There are no reviews for this add-on yet.

What are you waiting for? Rate it and review it!