Skip to content

Commit 506f5b0

Browse files
Merge pull request #11 from WestleyArgentum/dates
Calendar => Dates
2 parents dc988ad + cdf8204 commit 506f5b0

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ before_install:
1616
script:
1717
- julia -e "Pkg.init()"
1818
- julia -e 'Pkg.add("BinDeps")'
19-
- julia -e 'Pkg.add("Calendar")'
19+
- julia -e 'Pkg.add("Dates")'
2020
- julia -e 'Pkg.add("HttpParser")'
2121
- julia -e 'Pkg.add("FactCheck")'
2222
- mkdir -p ~/.julia/HttpCommon

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
julia 0.2-
2-
Calendar
2+
Dates
33
FactCheck 0.1.0-

src/HttpCommon.jl

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module HttpCommon
22

3-
using Calendar
3+
using Dates
44

55
export STATUS_CODES,
66
GET,
@@ -113,20 +113,15 @@ const HttpMethodNameToBitmask = (String => HttpMethodBitmask)[
113113

114114
const HttpMethodBitmaskToName = (HttpMethodBitmask => String)[v => k for (k, v) in HttpMethodNameToBitmask]
115115

116-
# Default HTTP headers
117-
# RFC 1123 datetime formatting constants
118-
RFC1123_FORMAT_STR = "EEE, dd MMM yyyy HH:mm:ss"
119-
120116
# Get RFC 1123 datetimes
121117
#
122118
# RFC1123_datetime( now() ) => "Wed, 27 Mar 2013 08:26:04 GMT"
123119
# RFC1123_datetime() => "Wed, 27 Mar 2013 08:26:04 GMT"
124120
#
125-
RFC1123_datetime(t::CalendarTime) = begin
126-
t = tz(t,"GMT")
127-
format(RFC1123_FORMAT_STR, t) * " GMT"
121+
RFC1123_datetime(t::DateTime) = begin
122+
Dates.format(t, Dates.RFC1123Format) * " GMT"
128123
end
129-
RFC1123_datetime() = RFC1123_datetime(now())
124+
RFC1123_datetime() = RFC1123_datetime(Dates.nowutc())
130125

131126
# HTTP Headers
132127
#

0 commit comments

Comments
 (0)