dateinterval.createfromdatestring(3) php man page | unix.com

Man Page: dateinterval.createfromdatestring

Operating Environment: php

Section: 3

DATEINTERVAL.CREATEFROMDATESTRING(3)					 1				      DATEINTERVAL.CREATEFROMDATESTRING(3)

DateInterval::createFromDateString - Sets up a DateInterval from the relative parts of the string

SYNOPSIS
publicstatic DateInterval DateInterval::createFromDateString (string $time)
DESCRIPTION
Uses the normal date parsers and sets up a DateInterval from the relative parts of the parsed string.
PARAMETERS
o $time - A date with relative parts. Specifically, the relative formats supported by the parser used for strtotime(3) and DateTime will be used to construct the DateInterval.
EXAMPLES
Example #1 Parsing valid date intervals <?php // Each set of intervals is equal. $i = new DateInterval('P1D'); $i = DateInterval::createFromDateString('1 day'); $i = new DateInterval('P2W'); $i = DateInterval::createFromDateString('2 weeks'); $i = new DateInterval('P3M'); $i = DateInterval::createFromDateString('3 months'); $i = new DateInterval('P4Y'); $i = DateInterval::createFromDateString('4 years'); $i = new DateInterval('P1Y1D'); $i = DateInterval::createFromDateString('1 year + 1 day'); $i = new DateInterval('P1DT12H'); $i = DateInterval::createFromDateString('1 day + 12 hours'); $i = new DateInterval('PT3600S'); $i = DateInterval::createFromDateString('3600 seconds'); ?>
RETURN VALUES
Returns a new DateInterval instance. PHP Documentation Group DATEINTERVAL.CREATEFROMDATESTRING(3)
Related Man Pages
gmmktime(3) - php
datetime.modify(3) - php
dateinterval(3) - php
datetimeimmutable(3) - php
dateinterval.createfromdatestring(3) - php
Similar Topics in the Unix Linux Community
I want to seperate my data by time of day
Finding the duplicate in a file....
Extract a string from another string in UNIX
[Solved] Using date command, getting previous day
A script to format a file (ideally PERL)