testtime.c 446 B

1234567891011121314151617181920212223
  1. #include "headers.h"
  2. void
  3. threadmain(int argc, char **argv)
  4. {
  5. ulong now, now2;
  6. vlong nttime;
  7. if (argc > 1) {
  8. nttime = strtoull(argv[1], 0, 0);
  9. now2 = smbtime2plan9time(nttime);
  10. print("%ld %s", now2, ctime(now2));
  11. }
  12. else {
  13. now = 1032615845;
  14. nttime = smbplan9time2time(now);
  15. print("0x%.llux\n", nttime);
  16. now2 = smbtime2plan9time(nttime);
  17. print("now %ld %s", now, ctime(now));
  18. print("now2 %ld %s", now2, ctime(now2));
  19. }
  20. }