downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

DirectoryIterator::getBasename> <DirectoryIterator::current
[edit] Last updated: Fri, 17 May 2013

view this page in

DirectoryIterator::getATime

(PHP 5)

DirectoryIterator::getATimeObtener el último acceso del elemento actual DirectoryIterator

Descripción

public int DirectoryIterator::getATime ( void )

Obtiene el último acceso del elemento actual DirectoryIterator.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

Devuelve la hora del último acceso al fichero, en formato Unix timestamp.

Ejemplos

Ejemplo #1 Ejemplo de DirectoryIterator::getATime()

Muestra una lista de los ficheros en el directorio del script y los últimos tiempos de acceso.

<?php
$iterator 
= new DirectoryIterator(dirname(__FILE__));
foreach (
$iterator as $fileinfo) {
    if (
$fileinfo->isFile()) {
        echo 
$fileinfo->getFilename() . " " $fileinfo->getATime() . "\n";
    }
}
?>

El resultado del ejemplo sería algo similar a:

manzana.jpg 1240047118
banana.jpg 1240065176
index.php 1240047208
pera.jpg 12240047979

Ver también



add a note add a note User Contributed Notes DirectoryIterator::getATime - [1 notes]
up
0
petweb at quaint dot info
4 years ago
Note that, as with filetime, the returned value is a Unix timestamp. So it can be used with the date() function;

date ("F d Y H:i:s.", filemtime($file->getATime()));

 
show source | credits | stats | sitemap | contact | advertising | mirror sites