Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

ASP Date question

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Next:  WMG/Widestore off line (e anche aruba a quanto pa..  
Author Message
nospam

External


Since: Apr 25, 2006
Posts: 21



(Msg. 1) Posted: Fri Feb 02, 2007 10:04 am
Post subject: ASP Date question
Archived from groups: alt>www>webmaster (more info?)

Hi

I'm trying to convert a list of dates from our Access database, currently in
the format 21/11/2006 into a unix timestamp (for the purposes of a RSS feed)
of the format: Tue, 21 Nov 2006 00:00:00 GMT.

Any ideas how to do this in vbscript / any other asp script languages? I've
googled a lot already but nothing seems to be suitable enough to help me out
in this instance : (

Thanks for any useful suggestions.

 >> Stay informed about: ASP Date question 
Back to top
Login to vote
Toby A Inkster

External


Since: Jan 28, 2007
Posts: 13



(Msg. 2) Posted: Fri Feb 02, 2007 12:04 pm
Post subject: Re: ASP Date question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

nospam wrote:

> I'm trying to convert a list of dates from our Access database, currently in
> the format 21/11/2006 into a unix timestamp (for the purposes of a RSS feed)
> of the format: Tue, 21 Nov 2006 00:00:00 GMT.

"Tue, 21 Nov 2006 00:00:00 GMT" is not a UNIX timestamp. A UNIX timestamp
for that date would be "0x45624180" -- UNIX timestamps are integers
(normally 32-bit signed integers) representing the number of seconds that
have elapsed since midnight on the 1st of January 1970.

What RSS requires, and what you are looking for is an RFC822-compliant
date. Googling for "rfc822 date format vbscript" turns up quite a few
results, including:

http://www.expertsforge.com/Web-Development/Tutorial-47.asp

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!

 >> Stay informed about: ASP Date question 
Back to top
Login to vote
Andy Dingley

External


Since: Mar 24, 2006
Posts: 248



(Msg. 3) Posted: Fri Feb 02, 2007 12:04 pm
Post subject: Re: ASP Date question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2 Feb, 12:04, Toby A Inkster <usenet200... RemoveThis @tobyinkster.co.uk>
wrote:
> nospam wrote:

> What RSS requires, and what you are looking for is an RFC822-compliant
> date.

Be careful with that. RSS 1.0 and Atom use the W3C standard of ISO
8601 format
(see also RFC3339 and http://www.w3.org/TR/NOTE-datetime )

It's just RSS 0.93 and RSS 2.0 that took the opposing view (probably
Winer's ego again) and switched to RFC822 format.

I hope that the OP's database stores them in native date format, not
as text strings. If they do, and they've used JScript for scripting
rather than VBScript, then this is easy to output however you'd like.
 >> Stay informed about: ASP Date question 
Back to top
Login to vote
nospam

External


Since: Apr 25, 2006
Posts: 21



(Msg. 4) Posted: Fri Feb 02, 2007 3:10 pm
Post subject: Re: ASP Date question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for the info - I used the link and found subsequent code that worked
well for my scenario.

Cheers!
 >> Stay informed about: ASP Date question 
Back to top
Login to vote
Toby A Inkster

External


Since: Jan 28, 2007
Posts: 13



(Msg. 5) Posted: Fri Feb 02, 2007 3:53 pm
Post subject: Re: ASP Date question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Andy Dingley wrote:

> Be careful with that. RSS 1.0 and Atom use the W3C standard of ISO
> 8601 format (see also RFC3339 and http://www.w3.org/TR/NOTE-datetime )
>
> It's just RSS 0.93 and RSS 2.0 that took the opposing view (probably
> Winer's ego again) and switched to RFC822 format.

IIRC, RSS 0.91 and 0.92 also used RFC822 format. In the wild, RSS 2.0, and
to a lesser extent, RSS 0.9x seem to be the most popular formats for RSS,
RSS 1.0 being relegated to a second-class citizen. Atom is catching on,
yes, but the original question wasn't about Atom.

Personally, I think the W3C's subset of ISO 8601 is a thing of great
beauty. RFC 822 dates are a lot more clumsy, embedding the day of the week
into the date, making purely lexical sorting impossible and tying a date
format to a particular language (English).

For what it's worth, as part of my hobby project <http://demiblog.org/> I'm
including a feed generator which outputs feeds in:

- RSS 0.91
- RSS 2.0
- Atom 1.0
- iCalendar
- HTML (hCalendar microformat)
- JSON
- Serialized PHP Data

The Feed generating classes are mostly finished, even if the project is far
from complete. It hasn't had much testing yet, so probably needs a little
debugging.

Source code is here:
http://svn.sourceforge.net/viewvc/demiblog/blog/includes/DemiBlog/Feed...ass?vie

Licence is GPL.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
 >> Stay informed about: ASP Date question 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
[OT] What happened on this date in... - What happened on this date in... 1492?

date ORDER BY - Hi, I'm currently running a sql select statement on a date field which is ordered by the date field in ascending order. It worked fine for the 1st to the 9th of the month but when it output 10th, 11th, 12th etc. it put them before the 1st. So I was..

Date/Time on Sites - Hi, can someone please advise where I can find out how to get an applet or something that can put the time and date on my site. Thanks

sorting recordset by date - SELECT * FROM for_sale ORDER BY ListDate Desc I want to limit it to last 7 days. How would the SQL be written for Access?

domain first registered date - I dont remember when I first registed a domain and I'd like to know the date for an article Im doing now - is it possible anywhere to confirm the first time a particular domain was registered?
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]