Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

date_timestamp_get()

Example

Get the Unix timestamp for the current date and time:

<?php
$date=date_create();
echo date_timestamp_get($date);
?>

Definition and Usage

The date_timestamp_get() function returns the Unix timestamp.

Syntax

date_timestamp_get(object)

Parameter Values

 

Parameter

Description

object

Required. Specifies a DateTime object created by date_create()

Technical Details

Return Value:

Returns the Unix timestamp representing the date.

PHP Version:

5.3+