Thread: UNIX Timestamp ? - Removing the Day

  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    3

    UNIX Timestamp ? - Removing the Day

    Hi all,


    I have been using ctime(), localtime(), and time() and I can't seem to find a way to get rid of the "Wed" for example out of the string that results from converting the st_mtime value of the stat struct.

    I have, thanks to Salem resuggesting I try chdir(), almost completed my personal rewrite of ls -l, and it is nearly identical to ls -l except for that my output runs out of char space and the filename is printed on the line after all of the other attributes are.

    This is very annoying..is the only answer to write your own time function?


    Any input would be greatly appreciated!

    Thanks,

    CHL

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Use strftime() to format time in a vast number of customisable formats.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unix Timestamp Creation
    By lavinpj1 in forum C Programming
    Replies: 3
    Last Post: 03-08-2009, 10:40 PM
  2. newbie needs help with code
    By compudude86 in forum C Programming
    Replies: 6
    Last Post: 07-23-2006, 08:54 PM
  3. convert integer unix timestamp to time
    By rotis23 in forum C Programming
    Replies: 2
    Last Post: 11-18-2002, 09:20 AM
  4. debug program
    By new_c in forum C Programming
    Replies: 3
    Last Post: 03-18-2002, 11:50 PM
  5. Simplified code
    By soonerfan in forum C Programming
    Replies: 2
    Last Post: 12-05-2001, 03:50 PM