Changes in tests/time.cfa [e0c235c:ba3df4d]
- File:
-
- 1 edited
-
tests/time.cfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/time.cfa
re0c235c rba3df4d 10 10 // Created On : Tue Mar 27 17:24:56 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jan 5 18:27:37 202013 // Update Count : 3412 // Last Modified On : Fri Nov 29 23:05:30 2019 13 // Update Count : 24 14 14 // 15 15 … … 34 34 sout | t; 35 35 t = t + d1; 36 sout | t | t `ns;36 sout | t | t.tv; 37 37 Time t1 = (timespec){ 104_414, 10_000_000 }; 38 sout | t1 | t1 `ns;39 sout | t - t | t + d5 | t `ns;40 char buf[ 64];38 sout | t1 | t1.tv; 39 sout | t - t | t + d5 | t.tv; 40 char buf[16]; 41 41 sout | "yy/mm/dd" | [t, buf]`ymd | nonl; // shared buf => separate calls 42 42 sout | "mm/dd/yy" | mm_dd_yy( t, buf ) | nonl; … … 45 45 sout | "dd/yy/mm" | [t, buf]`dmy; 46 46 Time t2 = { 2001, 7, 4, 0, 0, 1, 0 }, t3 = (timeval){ 994_219_201 }; 47 sout | t2 | t2 `ns | nl | t3 | t3`ns;47 sout | t2 | t2.tv | nl | t3 | t3.tv; 48 48 sout | nl; 49 49 … … 62 62 sout | "Dividing that by 2 gives" | s / 2 | "seconds"; 63 63 sout | s | "seconds is" | s`h | "hours," | (s % 1`h)`m | "minutes," | (s % 1`m)`s | "seconds"; 64 65 t1 = (Time){ 2020, 1, 5, 9, 0, 0, 100000000000LL };66 t2 = (Time){ 1969, 13, 5, 9 };67 t3 = (Time){ 1970, 25, 366, 48, 120, -120, 60000000000LL };68 strftime( buf, 128, "%Y %b %e %H:%M:%S (GMT)", t1 );69 sout | buf;70 strftime( buf, 128, "%Y %b %e %H:%M:%S (GMT)", t2 );71 sout | buf;72 strftime( buf, 128, "%Y %b %e %H:%M:%S (GMT)", t3 );73 sout | buf;74 64 } // main 75 65
Note:
See TracChangeset
for help on using the changeset viewer.