Skip to main content
Participant
August 18, 2009
Question

current date month year in flex

  • August 18, 2009
  • 1 reply
  • 13674 views

can anyone let me know how to get current system date in flex

and how to compare seleted date and system date in flex

thanks in advance

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    August 18, 2009

    below is the example code which get the date, month and year

    when you try to access the month it return less than one (if you try to get the month when the month is set to jan it return zero ) while displaying we need to increment as months starts from one

    import mx.controls.Alert;

    public function init():void

    {

    var dt:Date= new Date();

    Alert.show("date : "+dt.getDate().toString()+"\nmonth : "+Number(Number(dt.getMonth().toString())+1) +"\nYear : "+dt.getFullYear().toString());

    }

    if this post answers your question or helps, please mark it as such

    Participant
    August 18, 2009

    hi thats fine to get the current date but am using comboBox for date month and year when i select the current date

    it has to show the alert msg can u let me know how can i compare selected date month year and current date month year

    August 18, 2009

    Use a labelFunction with the ComboBox, and in the function do the compare.

    If this post answers your question or helps, please mark it as such.