By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,747 Members | 2,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,747 IT Pros & Developers. It's quick & easy.

How can I change a file's date?

P: n/a
I think this must be easy but, alas, I can't find it!
Is there any function I can use to change a file's date/time?

Feb 28 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Feb 28, 8:51 am, terrychangsh...@gmail.com wrote:
I think this must be easy but, alas, I can't find it!
Is there any function I can use to change a file's date/time?
It is ;) Have a look at http://at.php.net/manual/en/function.touch.php

bool touch ( string $filename [, int $time [, int $atime]] )

However, it does not really work under Windows.

Have fun
Martin

------------------------------------------------
online accounting on bash bases
Online Einnahmen-Ausgaben-Rechnung
http://www.ea-geier.at
------------------------------------------------
m2m server software gmbh
http://www.m2m.at

Feb 28 '07 #2

P: n/a
Martin Mandl - m2m tech support wrote:
On Feb 28, 8:51 am, terrychangsh...@gmail.com wrote:
>I think this must be easy but, alas, I can't find it!
Is there any function I can use to change a file's date/time?

It is ;) Have a look at http://at.php.net/manual/en/function.touch.php

bool touch ( string $filename [, int $time [, int $atime]] )

However, it does not really work under Windows.
That's an overstatement, In Windows you can not modify the date and time
of a *folder*. It works fine on files, though.

--
*****************************
Chuck Anderson Boulder, CO
http://www.CycleTourist.com
*****************************
Feb 28 '07 #3

P: n/a
On Feb 28, 7:36 pm, Chuck Anderson <websiteaddr...@seemy.sigwrote:
Martin Mandl - m2m tech support wrote:
bool touch ( string $filename [, int $time [, int $atime]] )
However, it does not really work under Windows.

That's an overstatement, In Windows you can not modify the date and time
of a *folder*. It works fine on files, though.
Didn't know that, happy to learn something new ;)

Cheers
Martin
------------------------------------------------
online accounting on bash bases
Online Einnahmen-Ausgaben-Rechnung
http://www.ea-geier.at
------------------------------------------------
m2m server software gmbh
http://www.m2m.at

Mar 1 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.