Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

datetimeimmutable(3) [php man page]

DATETIMEIMMUTABLE(3)							 1						      DATETIMEIMMUTABLE(3)

The DateTimeImmutable class

INTRODUCTION
This class behaves the same as DateTime except it never modifies itself but returns a new object instead. CLASS SYNOPSIS
DateTimeImmutable DateTimeImmutableDateTimeInterface Methods o public DateTimeImmutable::__construct NULL ([string $time = "now"], [DateTimeZone $timezone]) o public DateTimeImmutable DateTimeImmutable::add (DateInterval $interval) o publicstatic DateTimeImmutable DateTimeImmutable::createFromFormat (string $format, string $time, [DateTimeZone $timezone]) o publicstatic DateTimeImmutable DateTimeImmutable::createFromMutable (DateTime $datetime) o publicstatic array DateTimeImmutable::getLastErrors (void ) o public DateTimeImmutable DateTimeImmutable::modify (string $modify) o publicstatic DateTimeImmutable DateTimeImmutable::__set_state (array $array) o public DateTimeImmutable DateTimeImmutable::setDate (int $year, int $month, int $day) o public DateTimeImmutable DateTimeImmutable::setISODate (int $year, int $week, [int $day = 1]) o public DateTimeImmutable DateTimeImmutable::setTime (int $hour, int $minute, [int $second]) o public DateTimeImmutable DateTimeImmutable::setTimestamp (int $unixtimestamp) o public DateTimeImmutable DateTimeImmutable::setTimezone (DateTimeZone $timezone) o public DateTimeImmutable DateTimeImmutable::sub (DateInterval $interval) o public DateInterval DateTimeImmutable::diff (DateTimeInterface $datetime2, [bool $absolute = false]) o public string DateTimeImmutable::format (string $format) o public int DateTimeImmutable::getOffset (void ) o public int DateTimeImmutable::getTimestamp (void ) o public DateTimeZone DateTimeImmutable::getTimezone (void ) o public DateTimeImmutable::__wakeup (void ) PHP Documentation Group DATETIMEIMMUTABLE(3)

Check Out this Related Man Page

DATETIMEIMMUTABLE.GETTIMESTAMP(3)					 1					 DATETIMEIMMUTABLE.GETTIMESTAMP(3)

DateTime::getTimestamp - Gets the Unix timestamp

       Object oriented style

SYNOPSIS
public int DateTime::getTimestamp (void ) DESCRIPTION
int DateTimeImmutable::getTimestamp (void ) int DateTimeInterface::getTimestamp (void ) Procedural style int date_timestamp_get (DateTimeInterface $object) Gets the Unix timestamp. PARAMETERS
This function has no parameters. RETURN VALUES
Returns the Unix timestamp representing the date. EXAMPLES
Example #1 DateTimeImmutable.getTimestamp(3) example Object oriented style <?php $date = new DateTime(); echo $date->getTimestamp(); ?> Procedural style <?php $date = date_create(); echo date_timestamp_get($date); ?> The above examples will output something similar to: 1272509157 NOTES
Using U as the parameter to DateTime.format(3) is an alternative when using PHP 5.2. SEE ALSO
DateTime.setTimestamp(3), DateTime.format(3). PHP Documentation Group DATETIMEIMMUTABLE.GETTIMESTAMP(3)
Man Page

5 More Discussions You Might Find Interesting

1. What is on Your Mind?

How long is your commute to work?

I'm just curious about the amount of time it takes you to get to work in the morning and whether you drive a car, ride a bike, walk or take public transportation. On a typical day I drive 10-15 minutes from my house to my work location followed by a 10 walk from the parking lot (car park to my... (12 Replies)
Discussion started by: bluescreen
12 Replies

2. Shell Programming and Scripting

delete only part of a line

Hi, I've a file as below- I need to delete only the part of the line after the pattern 'extent /lock' and my output has to be like below. Thanks (7 Replies)
Discussion started by: dvah
7 Replies

3. Shell Programming and Scripting

awk command

Hi o/p - condition size < 16 (1 Reply)
Discussion started by: dvah
1 Replies

4. Shell Programming and Scripting

Extract a string from another string in UNIX

I have a string string="Please have a nice day and sleep well Replace_12123_31233_32134_12342 Good day" How do i replace "Replace_12123_31233_32134_1234" in the above string.?? Please help. Regards, Qwerty (3 Replies)
Discussion started by: qwertyu
3 Replies

5. Shell Programming and Scripting

Add year to array in perl

Need assistance in perl scripting . Is there a logic that i can implement to check the current year and add to an array . ex Current year is 2014 . If 2014 is not present add this year to array . @yar = qw(2013 2012 2011); foreach (@yar){ print "Year: $_ "; } @yar = qw(2014... (6 Replies)
Discussion started by: ajayram_arya
6 Replies