UNIX Timestamp ? - Removing the Day

This is a discussion on UNIX Timestamp ? - Removing the Day within the C Programming forums, part of the General Programming Boards category; Hi all, I have been using ctime(), localtime(), and time() and I can't seem to find a way to get ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,548
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 08:20 AM
  4. debug program
    By new_c in forum C Programming
    Replies: 3
    Last Post: 03-18-2002, 10:50 PM
  5. Simplified code
    By soonerfan in forum C Programming
    Replies: 2
    Last Post: 12-05-2001, 02:50 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21