Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
52b1e50c
Commit
52b1e50c
authored
Nov 20, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged fix to rfc1123_date formatting
parent
4ed67d05
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
lib/python/App/Common.py
lib/python/App/Common.py
+7
-8
No files found.
lib/python/App/Common.py
View file @
52b1e50c
...
...
@@ -85,7 +85,7 @@
"""Commonly used utility functions."""
__version__
=
'$Revision: 1.
7
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
import
sys
,
os
,
time
from
string
import
rfind
...
...
@@ -101,16 +101,17 @@ monthname = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul'
,
'Aug'
,
'Sep'
,
'Oct'
,
'Nov'
,
'Dec'
]
def
iso8601_date
(
ts
=
None
,
format
=
'%Y-%m-%dT%H:%M:%SZ'
):
def
iso8601_date
(
ts
=
None
):
# Return an ISO 8601 formatted date string, required
# for certain DAV properties.
# '2000-11-10T16:21:09-08:00
if
ts
is
None
:
ts
=
time
.
time
()
return
time
.
strftime
(
format
,
time
.
gmtime
(
ts
))
return
time
.
strftime
(
'%Y-%m-%dT%H:%M:%SZ'
,
time
.
gmtime
(
ts
))
def
rfc850_date
(
ts
=
None
,
format
=
'%A, %d-%b-%y %H:%M:%S GMT'
):
def
rfc850_date
(
ts
=
None
):
# Return an HTTP-date formatted date string.
# 'Friday, 10-Nov-00 16:21:09 GMT'
if
ts
is
None
:
ts
=
time
.
time
()
year
,
month
,
day
,
hh
,
mm
,
ss
,
wd
,
y
,
z
=
time
.
gmtime
(
ts
)
return
"%s, %02d-%3s-%2s %02d:%02d:%02d GMT"
%
(
weekday_full
[
wd
],
...
...
@@ -118,15 +119,13 @@ def rfc850_date(ts=None, format='%A, %d-%b-%y %H:%M:%S GMT'):
str
(
year
)[
2
:],
hh
,
mm
,
ss
)
def
rfc1123_date
(
ts
=
None
,
format
=
'%a, %d %b %Y %H:%M:%S GMT'
):
def
rfc1123_date
(
ts
=
None
):
# Return an RFC 1123 format date string, required for
# use in HTTP Date headers per the HTTP 1.1 spec.
# 'Fri, 10 Nov 2000 16:21:09 GMT'
# XXX It looks like the 'format' argument is not just unused, but
# useless. klm 11/13/2000.
if
ts
is
None
:
ts
=
time
.
time
()
year
,
month
,
day
,
hh
,
mm
,
ss
,
wd
,
y
,
z
=
time
.
gmtime
(
ts
)
return
"%s, %02d
-%3s-
%4d %02d:%02d:%02d GMT"
%
(
weekday_abbr
[
wd
],
return
"%s, %02d
%3s
%4d %02d:%02d:%02d GMT"
%
(
weekday_abbr
[
wd
],
day
,
monthname
[
month
],
year
,
hh
,
mm
,
ss
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment