473,473 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
2 3629
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
@
> >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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: koen colen | last post by:
Hello group, I hope you guys can help me out, I am modifying a piece of code from Joe Norman, I did found the code here: http://www.intranet2internet.com/public/default.asp?PAGE=sscript&ID=3 ...
12
by: chrism | last post by:
Hello, I have a pop-up window that I would like to appear in front of the browser home page when a user opens IE. Problem is, I'd like it to never appear again if the user navigates back to the...
5
by: Connie Walsh | last post by:
Hi: I gleaned a javascript off of the web: http://www.hypergurl.com/popup.html that sets a cookie everytime someone visits your site. If it is the first visit in x number of days then a...
2
by: Jim | last post by:
Hi, I have an Asp.Net 1.1 site which uses basic forms authentication. This has been working fine, since way back in the 1.0 days. Twice in the last 2 months, a client has been unable to log in,...
2
by: George Durzi | last post by:
When you call FormsAuthentication.SignOut(), is the FormsAuthentication cookie supposed to be destroyed automatically? I'm creating my FormsAuthentication cookie by doing: HttpCookie oCookie =...
4
by: 23s | last post by:
I had this problem in the past, after a server reformat it went away, and now after another server reformat it's back again - no clue what's doing it. Here's the flow: Website root is public, no...
1
by: Jim | last post by:
Hi, I have an Asp.Net 1.1 site which uses basic forms authentication. This has been working fine, since way back in the 1.0 days. Twice in the last 2 months, a client has been unable to log in,...
4
by: Phil Powell | last post by:
I thought this would work but it seems to not work neither in Netscape nor in IE: <script type="text/javascript"> <!-- // OBTAINED FROM http://www.javascripter.net/faq/settinga.htm //...
2
by: itay_k | last post by:
Hi, I want to send a cookie on some http request (with urllib2), so I created a Cookie but I cant associate it with CookieJar object. for example: import Cookie import cookielib, urllib2
9
by: _Who | last post by:
I have a .htm file that shows in an iframe which is part of a master's asp:Content. I need the .htm to copy the style class from the master or set it as shown below. Below is how I set the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.