473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

How can I change a file's date?

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
3 7326
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: [ EuGeNe ] | last post by:
Hi all, I would like to write a script that downloads one file from a ftp server if the file creation date satisfy a condition. I can't figure out how to find from a ftp server what is the...
1
by: Dave Lambert | last post by:
Hi, hope someone can help, I would like to change permissions on a folder and wondered if it is possible as part of an automated install, the reason being we have created an install for an asp.net...
1
by: Laurence Neville | last post by:
This is regarding a change in the Short Date format under Hebrew Regional Settings, that has caused huge problems in our ASP web application. The change appears to have been introduced sometime...
3
by: sparks | last post by:
Have to read in a bunch of files into access and wanted to ask is there a way to read the file modification date before reading them in so I don't read files that I have already read? man thats...
4
by: wil | last post by:
Dear All, In the linux platform, is there anyway I can in a C program change the file create date? Thanks, wil.
6
by: KoRnDragon | last post by:
I know about getlastmod() but is there one for created date? If not is there some other way of getting the created date of a file?
1
by: avinashpr | last post by:
Hi, How do i fetch the information pertaining to a file like file creation date, modified date.....in c++. small code snippet is hieghly appreceated cheers, avinash
1
by: Enij | last post by:
Hi All, I'm using VB.net 2003 Standard Edition, and I'm trying to retrieve the file modified date. Sounds painfully simple. Yup. But ... I cannot, for the life of me, figure it out. After...
2
by: gavin9822623 | last post by:
I need to set a file creation date to "2005/01/01 13:00:00 PM". The date format is (YYYY/MM/DD). Any help or example will be greatly appreciated. Thank you Gavin
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.