By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,389 Members | 2,044 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,389 IT Pros & Developers. It's quick & easy.

How do I convert TIME into Cookie and last-modified-time format?

P: n/a
First of all, I want to know if Cookie's expiration time and HTTP's header's
last modified time are using the same format.

Secondly, how do I format the time from a 10923023324324 kind of number into
the cookie and http header format(s)?
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Fri, 1 Oct 2004 14:05:38 -0400, <12*@abc.xyz> wrote:
First of all, I want to know if Cookie's expiration time and HTTP's header's
last modified time are using the same format.
http://wp.netscape.com/newsref/std/cookie_spec.html

http://www.w3.org/Protocols/rfc2616/rfc2616.html
http://www.w3.org/Protocols/rfc2616/...c3.html#sec3.3

So, not necessarily.
Secondly, how do I format the time from a 10923023324324 kind of number into
the cookie and http header format(s)?


Depends what "10923023324324" is? That's too many digits for a UNIX timestamp
(would be about 350,000 years in the future), and one too many for a Java
milliseconds-since-epoch timestamp (about 2323AD I think).

Once you've got a UNIX timestamp, use date() to format it.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2

P: n/a
@
> >First of all, I want to know if Cookie's expiration time and HTTP's
header's
last modified time are using the same format.


http://wp.netscape.com/newsref/std/cookie_spec.html

http://www.w3.org/Protocols/rfc2616/rfc2616.html
http://www.w3.org/Protocols/rfc2616/...c3.html#sec3.3

So, not necessarily.


?? I think
850 is the only thing working in both
3.3 Date/Time Formats
3.3.1 Full Date
HTTP applications have historically allowed three different formats for the
representation of date/time stamps:

Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
The date string is formatted as:

Wdy, DD-Mon-YYYY HH:MM:SS GMT
This is based on RFC 822, RFC 850, RFC 1036, and RFC 1123, with the
variations that the only legal time zone is GMT and the separators between
the elements of the date must be dashes.
Dash and GMT are the keys. Only 850 uses dashes.
The unix date returns Sat Oct 2 00:58:14 EDT 2004
Which is ANSI, not RFC 850
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.