2016-03-30 23:04:14 -04:00
|
|
|
USING: accessors calendar calendar.format io io.streams.string
|
|
|
|
kernel math.order sequences tools.test ;
|
2013-04-24 11:22:33 -04:00
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ 0 } [
|
2013-04-24 11:22:33 -04:00
|
|
|
"Z" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours
|
|
|
|
] unit-test
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ 1 } [
|
2013-04-24 11:22:33 -04:00
|
|
|
"+01" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours
|
|
|
|
] unit-test
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ -1 } [
|
2013-04-24 11:22:33 -04:00
|
|
|
"-01" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours
|
|
|
|
] unit-test
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ -1-1/2 } [
|
2013-04-24 11:22:33 -04:00
|
|
|
"-01:30" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours
|
|
|
|
] unit-test
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ 1+1/2 } [
|
2013-04-24 11:22:33 -04:00
|
|
|
"+01:30" [ read1 read-rfc3339-gmt-offset ] with-string-reader duration>hours
|
|
|
|
] unit-test
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ } [ now timestamp>rfc3339 drop ] unit-test
|
|
|
|
{ } [ now timestamp>rfc822 drop ] unit-test
|
2013-04-24 11:22:33 -04:00
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ 8/1000 -4 } [
|
2013-04-24 11:22:33 -04:00
|
|
|
"2008-04-19T04:56:00.008-04:00" rfc3339>timestamp
|
|
|
|
[ second>> ] [ gmt-offset>> hour>> ] bi
|
|
|
|
] unit-test
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ T{ duration f 0 0 0 0 0 0 } } [
|
2013-04-24 11:22:33 -04:00
|
|
|
"GMT" parse-rfc822-gmt-offset
|
|
|
|
] unit-test
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ T{ duration f 0 0 0 -5 0 0 } } [
|
2013-04-24 11:22:33 -04:00
|
|
|
"-0500" parse-rfc822-gmt-offset
|
|
|
|
] unit-test
|
|
|
|
|
2016-12-31 16:50:08 -05:00
|
|
|
{ T{ duration f 0 0 0 -1 0 0 } } [
|
|
|
|
"A" parse-rfc822-gmt-offset
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
{ T{ duration f 0 0 0 12 0 0 } } [
|
|
|
|
"Y" parse-rfc822-gmt-offset
|
|
|
|
] unit-test
|
2017-01-03 00:09:09 -05:00
|
|
|
|
2016-12-31 16:50:08 -05:00
|
|
|
{ T{ duration f 0 0 0 -8 0 0 } } [
|
|
|
|
"PST" parse-rfc822-gmt-offset
|
|
|
|
] unit-test
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ T{ timestamp f 2008 4 22 14 36 12 T{ duration f 0 0 0 0 0 0 } } } [
|
2013-04-24 11:22:33 -04:00
|
|
|
"Tue, 22 Apr 2008 14:36:12 GMT" rfc822>timestamp
|
|
|
|
] unit-test
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ t } [ now dup timestamp>rfc822 rfc822>timestamp time- 1 seconds before? ] unit-test
|
2013-04-24 11:22:33 -04:00
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ t } [ now dup timestamp>cookie-string cookie-string>timestamp time- 1 seconds before? ] unit-test
|
2013-04-24 11:22:33 -04:00
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ "Sun, 4 May 2008 07:00:00" } [
|
2013-04-24 11:22:33 -04:00
|
|
|
"Sun May 04 07:00:00 2008 GMT" cookie-string>timestamp
|
|
|
|
timestamp>string
|
|
|
|
] unit-test
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ "20080504070000" } [
|
2013-04-24 11:22:33 -04:00
|
|
|
"Sun May 04 07:00:00 2008 GMT" cookie-string>timestamp
|
|
|
|
timestamp>mdtm
|
|
|
|
] unit-test
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{
|
2013-04-24 11:22:33 -04:00
|
|
|
T{ timestamp f
|
|
|
|
2008
|
|
|
|
5
|
|
|
|
26
|
|
|
|
0
|
|
|
|
37
|
|
|
|
42+2469/20000
|
|
|
|
T{ duration f 0 0 0 -5 0 0 }
|
|
|
|
}
|
2015-07-03 12:39:59 -04:00
|
|
|
} [ "2008-05-26T00:37:42.12345-05:00" rfc3339>timestamp ] unit-test
|
2013-04-24 11:22:33 -04:00
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{
|
2013-04-24 11:22:33 -04:00
|
|
|
T{ timestamp
|
|
|
|
{ year 2008 }
|
|
|
|
{ month 10 }
|
|
|
|
{ day 2 }
|
|
|
|
{ hour 23 }
|
|
|
|
{ minute 59 }
|
|
|
|
{ second 59 }
|
|
|
|
{ gmt-offset T{ duration f 0 0 0 0 0 0 } }
|
|
|
|
}
|
2015-07-03 12:39:59 -04:00
|
|
|
} [ "Thursday, 02-Oct-2008 23:59:59 GMT" cookie-string>timestamp ] unit-test
|
2013-04-24 11:22:33 -04:00
|
|
|
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ }
|
2013-04-24 11:22:33 -04:00
|
|
|
[ { 2008 2009 } [ year. ] each ] unit-test
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{
|
2013-04-24 11:22:33 -04:00
|
|
|
T{ timestamp
|
|
|
|
{ year 2013 }
|
|
|
|
{ month 4 }
|
|
|
|
{ day 23 }
|
|
|
|
{ hour 13 }
|
|
|
|
{ minute 50 }
|
|
|
|
{ second 24 }
|
|
|
|
}
|
2015-07-03 12:39:59 -04:00
|
|
|
} [ "2013-04-23T13:50:24" rfc3339>timestamp ] unit-test
|
2014-06-01 09:48:06 -04:00
|
|
|
|
2014-10-08 18:36:08 -04:00
|
|
|
{ "2001-12-14T21:59:43.100000-05:00" } [ "2001-12-14T21:59:43.1-05:00" rfc3339>timestamp timestamp>rfc3339 ] unit-test
|
2014-07-01 17:42:25 -04:00
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{
|
2014-06-01 09:48:06 -04:00
|
|
|
T{ timestamp
|
|
|
|
{ year 2001 }
|
|
|
|
{ month 12 }
|
|
|
|
{ day 15 }
|
|
|
|
{ hour 02 }
|
|
|
|
{ minute 59 }
|
|
|
|
{ second 43+1/10 }
|
|
|
|
}
|
2015-07-03 12:39:59 -04:00
|
|
|
} [ "2001-12-15 02:59:43.1Z" rfc3339>timestamp ] unit-test
|
2014-06-01 09:48:06 -04:00
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{
|
2014-06-01 09:48:06 -04:00
|
|
|
T{ timestamp
|
|
|
|
{ year 2001 }
|
|
|
|
{ month 12 }
|
|
|
|
{ day 15 }
|
|
|
|
{ hour 02 }
|
|
|
|
{ minute 59 }
|
|
|
|
{ second 43+1/10 }
|
|
|
|
}
|
2015-07-03 12:39:59 -04:00
|
|
|
} [ "2001-12-15 02:59:43.1Z" rfc3339>timestamp ] unit-test
|