home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 242,796 of 243,242   
   Kenny McCormack to Richard Tobin   
   Re: printf and time_t   
   05 Jan 26 15:36:09   
   
   From: gazelle@shell.xmission.com   
      
   In article <10jgj92$1o88k$1@artemis.inf.ed.ac.uk>,   
   Richard Tobin  wrote:   
   >In article <10jfol6$2u6r8$1@news.xmission.com>,   
   >Kenny McCormack  wrote:   
   >>The question is: How can you reliably printf() a time_t value?   
   >   
   >Do you want to print it in a human-understandable format?  Or a   
   >non-binary format?  Or just in a way that's re-readable?   
      
   In the instant case, I want the "number of seconds since the Unix epoch"   
   number.  That's human-understandable enough for my purposes.   
      
   (Note that if you really want human-readable, you can push it through   
   ctime() and then you don't have to worry about the format string (it is and   
   always will be "%s"))   
      
   And, yes, I am assuming POSIX-ish (in fact, Linux) throughout, so don't   
   really care about ISO C eccentricities.   
      
   As I've commented in other posts on this thread, it would certainly be   
   possible for a C compiler to do this - but it may not be in the spirit of C   
   for it to do so.  Bart has certainly shown us the way.   
      
   --   
   What are your thoughts on Alabama politicians declaring Donald Trump one   
   of the greatest presidents ever?   
      
   Alabama is ranked #47 in education out of 50 states. Now we know why.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca