summaryrefslogtreecommitdiffstats
path: root/tests/optional.test
blob: 6847ebe578a6ea8f600e884b37a146fb5eff6b19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# See tests/jq.test and the jq manual for more information.

# strptime() is not available on mingw/WIN32
[strptime("%Y-%m-%dT%H:%M:%SZ")|(.,mktime)]
"2015-03-05T23:51:47Z"
[[2015,2,5,23,51,47,4,63],1425599507]

# Check day-of-week and day of year computations
# (should trip an assert if this fails)
last(range(365 * 199)|("1970-03-01T01:02:03Z"|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime) + (86400 * .)|strftime("%Y-%m-%dT%H:%M:%SZ")|strptime("%Y-%m-%dT%H:%M:%SZ"))
null
[2169,0,10,1,2,3,1,9]

# %e is not available on mingw/WIN32
strftime("%A, %B %e, %Y")
1435677542.822351
"Tuesday, June 30, 2015"