User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 402,405 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,996 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums

Timestamp

Join Date: Feb 2008
Location: Seattle
Posts: 713
Reputation: jephthah is a jewel in the rough jephthah is a jewel in the rough jephthah is a jewel in the rough 
Rep Power: 4
Solved Threads: 45
jephthah's Avatar
jephthah jephthah is offline Offline
Master Poster

Re: Timestamp

  #4  
May 14th, 2008
  1. #include <stdio.h>
  2. #include <time.h>
  3.  
  4. int main ()
  5. {
  6. time_t unixTime;
  7. FILE * fp;
  8. char stamp[32];
  9.  
  10. unixTime = time (NULL);
  11. fprintf (stamp,"timestamp: %ld\n", unixTime);
  12. if (fp = fopen("myfile.txt","a"))
  13. {
  14. fputs(stamp,fp);
  15. fclose(fp);
  16. }
  17. return 0;
  18. }


f you want to know what "unix time" is and how you can make it more meaningful to the average person... look up "time.h"


.
Last edited by jephthah : May 14th, 2008 at 5:40 pm.
Why so serious?
Reply With Quote  
All times are GMT -4. The time now is 1:47 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC