My slstatus configuration
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

20 řádky
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. }