Coder Social home page Coder Social logo

php_datetime's Introduction

PHP_DateTime

Extra functionality for PHP's DateTime class

__construct([String datetime [, Array working_days [, Array holidays]]])
datetime is a datetime string in sql datetime format (YYYY-mm-dd HH:mm:ss) Default null
__construct([Integer timestamp [, Array working_days [, Array holidays]]])
timestamp is a unix timestamp integer Default null

If no datetime or timestamp is given then the date and time of the server at the instance of the
object will be used. If $GLOBALS['dbh'] holds a valid database handle and a defined var of USE_DATABASE_TME is set to 'True' then the database time of 'now()' will be used.


working_days is an array of numbers:
1: Monday
2: Tuesday
3: Wednesday
4: Thursday
5: Friday
6: Saturday
7: Sunday
working_days default null
holidays is an array of datetime strings in sql datetime format (YYYY-mm-dd HH:mm:ss) Default null
add_working_days(Integer days_to_add [, Array working_days [, Array holidays [, String returns]]])
Use working_days and holidays to change the respective arrays set in the construct. Both default null.
returns is a string to format the datetime returned. Default null.
if returns is set then method will return a datetime string of format given
minus_working_days(Integer days_to_add [, Array working_days [, Array holidays [, String returns]]])
use working_days and holidays to change the respective arrays set in the construct. Both default null.
returns is a string to format the datetime returned. Default null.
if returns is set then method will return a datetime string of format given

php_datetime's People

Contributors

joneschrisan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.