Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 54451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:13:20+00:00 2026-05-10T17:13:20+00:00

I’d like to know if Flash/AS3 has any nice way to convert an AS3

  • 0

I’d like to know if Flash/AS3 has any nice way to convert an AS3 ‘Date’ object to/from rfc-850 timestamp format (as used by HTTP date and last-modified).

This question is very similar to this question about rfc 3339, except it’s specific to AS3 and rfc-850.

RFC-850 is like: Thu, 09 Oct 2008 01:09:43 GMT

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:13:20+00:00Added an answer on May 10, 2026 at 5:13 pm

    Alright, so here’s a couple of functions to do RFC-802/Date conversion in Flash.

    I learned that the Date object doesn’t really have any notion of a timezone, and assumes that it is in the local timezone. If you pass an RFC-802 date to the Date() constructor, it parses it everything except the ‘GMT’ timezone token at the end, resulting in the correct time but possibly in the wrong timezone.

    Subtracting the current timezone from the parsed Date compensates for this, so a timestamp can do a round-trip with these functions without becoming completely wrong.

    (Wouldn’t it have been great if somebody had included a timezone property when they were designing the Date class?)

    /**  * Converts an RFC string to a Date object.  */ function fromRFC802(date:String):Date {     // Passing in an RFC802 date to the Date constructor causes flash     // to conveniently ignore the 'GMT' timezone at the end, and assumes     // that it's in the Local timezone.     // If we additionally convert it back to GMT, then we're sweet.      var outputDate:Date = new Date(date);     outputDate = new Date(outputDate.time - outputDate.getTimezoneOffset()*1000*60);     return outputDate; }  /**   * Converts a Date object to an RFC802-formatted string (GMT/UTC).  */ function toRFC802 (date:Date):String {     // example: Thu, 09 Oct 2008 01:09:43 GMT      // Convert to GMT      var output:String = '';      // Day     switch (date.dayUTC) {     case 0: output += 'Sun'; break;     case 1: output += 'Mon'; break;     case 2: output += 'Tue'; break;     case 3: output += 'Wed'; break;     case 4: output += 'Thu'; break;     case 5: output += 'Fri'; break;     case 6: output += 'Sat'; break;     }      output += ', ';      // Date     if (date.dateUTC < 10) {         output += '0'; // leading zero     }     output += date.dateUTC + ' ';      // Month     switch(date.month) {     case 0: output += 'Jan'; break;     case 1: output += 'Feb'; break;     case 2: output += 'Mar'; break;     case 3: output += 'Apr'; break;     case 4: output += 'May'; break;     case 5: output += 'Jun'; break;     case 6: output += 'Jul'; break;     case 7: output += 'Aug'; break;     case 8: output += 'Sep'; break;     case 9: output += 'Oct'; break;     case 10: output += 'Nov'; break;     case 11: output += 'Dec'; break;     }      output += ' ';      // Year     output += date.fullYearUTC + ' ';      // Hours     if (date.hoursUTC < 10) {         output += '0'; // leading zero     }     output += date.hoursUTC + ':';      // Minutes     if (date.minutesUTC < 10) {         output += '0'; // leading zero     }     output += date.minutesUTC + ':';      // Seconds     if (date.seconds < 10) {         output += '0'; // leading zero     }     output += date.secondsUTC + ' GMT';      return output; }  var dateString:String = 'Thu, 09 Oct 2008 01:09:43 GMT';  trace('Round trip proof:');  trace(' RFC-802: ' + dateString); trace('Date obj: ' + fromRFC802(dateString)); trace(' RFC-802: ' + toRFC802(fromRFC802(dateString))); trace('Date obj: ' + fromRFC802(toRFC802(fromRFC802(dateString)))); trace(' RFC-802: ' + toRFC802(fromRFC802(toRFC802(fromRFC802(dateString))))); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 58k
  • Answers 58k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer OK, I've adapted @Richard's answer: public static int transferAsMuchAsPossible( ByteBuffer… May 11, 2026 at 8:46 am
  • added an answer Have you profiled the code and actually found it to… May 11, 2026 at 8:46 am
  • added an answer Interfaces don't force classes to use methods. They force implementing… May 11, 2026 at 8:46 am

Related Questions

No related questions found

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.