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

  • SEARCH
  • Home
  • 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 6089547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:06:43+00:00 2026-05-23T12:06:43+00:00

How can I get a date in a format like this out of Flash

  • 0

How can I get a date in a format like this out of Flash AS3?

January-01-2011

Thanks

  • 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. Editorial Team
    Editorial Team
    2026-05-23T12:06:44+00:00Added an answer on May 23, 2026 at 12:06 pm

    You can use the formatDate() function I made in the following example to format the date the way you want it:

    package 
    {
        import flash.display.Sprite;
        import flash.events.Event;
    
        public class Main extends Sprite 
        {
            public function Main():void 
            {
                if (stage) init();
                else addEventListener(Event.ADDED_TO_STAGE, init);
    
            }// end function
    
            private function init(e:Event = null):void 
            {
                removeEventListener(Event.ADDED_TO_STAGE, init);
    
                var date:Date = new Date();
    
                trace(formatDate(date)); // output: June-02-2011
    
            }// end function
    
            private function formatDate(date:Date):String
            {
                var month:String, dateString:String, year:String;
    
                var months:Array = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
    
                month = months[date.getMonth() - 1]
    
                dateString = (date.getDate() < 10) ? "0" + date.getDate().toString() : date.getDate().toString();
    
                year = date.getFullYear().toString();
    
                return month + "-" + dateString + "-" + year; 
    
            }// end function
    
        }// end class
    
    }// end package
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anybody help me get this date format like Fri, 01 Oct 22:26:23 +0200
How can i get the percentage of the changes which happened? Like 1. date
So I've got a text input that get's date & time in this format:
I have a date in this format 11/28/2011 2:39:00 PM I cant seem to
In php i can get today date/day by using : $today = date('D, Y-m-d');
I can get the created date, file size etc for a file using the
How can I get the date for Monday and Friday for the current week?
How can i get the date from database and load it onto the UIDatePicker?
How can I get last year's start and end date using PHP code? Is
I want to store the current date & time which can be get by

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.