ISO to RFC822

J

John Smith

Hi,

I've been carefully storing my dates as ISO dates in a DB and now have to
add an RSS feed to a website. Is there an easy way to convert these dates to
RFC822 compliant dates ? I've had a look for a component of some sort but
had no luck.Any Pointers ?

Thanks

J
 
M

Mark Schupp

Are the dates being stored in the database in character columns? They should
be stored as date-time columns.

If they are date-time then you just need to format them to RFC822 format
when you output them. If you can give a link to the format (or list it here)
then someone can probably show you some formatting code.
 
J

John Smith

Are the dates being stored in the database in character columns? They
should be stored as date-time columns.

If they are date-time then you just need to format them to RFC822 format
when you output them. If you can give a link to the format (or list it
here) then someone can probably show you some formatting code.

Hi Mark,

These are stored as ISO dates (e.g. 20050726 for today) without
the time format (I was going to dispense with this!).

The RFC-822 compliant equivalent would be Tue, 26 Jul 2005.

The other option is just starting fresh and storing RFC compliant details
in a new column !

Thanks

J
 
A

Aaron Bertrand [SQL Server MVP]

VBScript and T-SQL are both capable of outputting . I'm not sure this
specific style is covered, but these should get you started:

http://www.aspfaq.com/2313
http://www.aspfaq.com/2460
http://www.aspfaq.com/2464

FWIW, I think it is more the job of ASP to provide the presentation format,
unless you are converting completely to something like FOR XML right out of
the database and skipping the ASP logic side of things.

And I will have to agree with Mark. These are datetime values, store them
as datetime, THEY ARE NOT STRINGS!
 
J

John Smith

Thanks for that Aaron, I'll take a look at the samples.

I'll defend myself slightly and say that originally RSS wasn't in the
picture so
I stored the dates accordingly as they are mainly used for
searches, 'last updated' and a few other things !

Alas we are all at the mercy of client whims...............

Thanks

J
 
A

Aaron Bertrand [SQL Server MVP]

I stored the dates accordingly as they are mainly used for
searches, 'last updated' and a few other things !

That still doesn't help justify CHAR/VARCHAR as a better choice. In fact,
it adds to the argument FOR a proper data type.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top