My slstatus configuration
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

20 行
346 B

  1. /* See LICENSE file for copyright and license details. */
  2. #include <stdio.h>
  3. #include <time.h>
  4. #include "../util.h"
  5. const char *
  6. datetime(const char *fmt)
  7. {
  8. time_t t;
  9. t = time(NULL);
  10. if (!strftime(buf, sizeof(buf), fmt, localtime(&t))) {
  11. fprintf(stderr, "strftime: Result string exceeds buffer size\n");
  12. return NULL;
  13. }
  14. return buf;
  15. }