e107 Developer Guide
  • Welcome
  • Getting Started
    • Hello world example
    • Folder structure
    • Database structure
    • Debugging & problem solving
  • Classes and methods
    • Introduction
    • Alerts
    • Cache
    • CSS
    • Database
    • Date
    • Events
    • Forms
    • Javascript
    • Language
    • Logging
    • Meta
    • Parser
    • Plugins
    • Preferences
    • Redirection
    • Render
    • Route
    • URLs
    • User Data
  • Plugin development
    • Introduction
    • Plugin Builder
    • Admin-UI (User Interface)
    • Installation & configuration
    • Plugin shortcodes
    • Internationalisation (LAN)
    • Extending core functionality (addons)
    • Upgrading legacy plugins
  • Theme development
    • Introduction
    • Installation & configuration
    • Layout & templates
    • Theme Shortcodes
    • Styling (CSS)
    • Upgrading legacy themes
  • Templates, shortcodes & constants
    • Introduction
    • Templates
    • Shortcodes
    • Core Shortcodes
    • Constants
  • How-to's / FAQs
    • How to...
Powered by GitBook
On this page
  • Introduction
  • Date methods
  • computeLapse()
  • convert_date()
  • terms()

Was this helpful?

Export as PDF
  1. Classes and methods

Date

Please note: This page is under construction and has not been finished yet.

Introduction

$gen = e107::getDate();

Date methods

computeLapse()

Calculate difference between two dates for display in terms of years/months/weeks....

$gen->computeLapse($older_date, $newer_date = FALSE, $mode = FALSE, $show_secs = TRUE, $format = 'long') 
Parameter
Type
Description
Mandatory?

older_date

integer

UNIX timestamp

Yes

newer_date

integer

UNIX timestamp

Default: current time

No

mode

boolean

if true return value is an array. Otherwise return value is a string

Default: false

No

show_secs

boolean

Default: true

No

format

string

Format of the human readable date. Options:

  • long

  • short (omits the year)

Default: long

No

convert_date()

Convert datestamp to human readable date. System time offset is considered.

$gen->convert_date($datestamp, $mask = '')
Parameter
Type
Description
Mandatory?

datestamp

integer

UNIX timestamp

Yes

mask

string

Format of the human readable date. Options:

  • long

  • short

  • forum

  • relative

Default: long

No

terms()

Return an array of language terms representing months

$gen->terms($type='month')

Parameter
Type
Description
Mandatory?

type

string

Options:

  • month (August)

  • month-short (Aug)

  • day (Tuesday)

  • day-short (Tue)

  • day-shortest (Tu)

Default: month

Yes

PreviousDatabaseNextEvents

Last updated 3 years ago

Was this helpful?

(any valid string)

The configuration of the mask formats are specified in Admin Area > Preferences > .

👉
Date Display options
👉
strftime()