Re: Using a file's modification date in the filename



cca.johnson@xxxxxxxxx wrote:
I want to be able to rename a file and prepend the file's modification
date at the front of the file. For example:
with a file named testme.txt and a modification date of April 1, 2006,
I want the renamed file to be named 20060401-testme.txt

What I can do is get the modification date using ctime, but it I can't
figure out how to format the output.

It seems like Date::Formatter will probably do what you are looking for.

jue
.



Relevant Pages

  • Re: Unix equivalent of SYS$BINTIM ?
    ... Does anyone know if there is an equivalent to this in UNIX? ... I have found routines that get time from unix binary format to text ... asctime, asctime_r, ctime, ctime_r, gmtime, gmtime_r, localtime, ...
    (comp.os.vms)
  • Re: Converting from GMT
    ... CTime time); ... > call to get the current GMT offset? ... I use a COleDateTime object to format the ... > date/time for the user in their preferred format. ...
    (microsoft.public.vc.mfc)
  • Re: How to get a CTime from a string
    ... Here is a function I use for a very specific date format. ... parsing it manually, but it might give you some ideas. ... // Converts a char string US date to a CTime. ...
    (microsoft.public.vc.mfc)
  • A macro to update links
    ... defined format. ... Each month this file is updated and renamed file and it is now ... Is there a macro that can be run to update link names? ... I am quite a novice so would appreciate the code. ...
    (microsoft.public.excel.programming)
  • Re: passing variable number of arguments to a function
    ... your own with sprintf() and localtime. ... I wrote a wrapper function to print the ctime() without newline. ... I don't like the format of the string ...
    (comp.lang.c)