Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Functions for month/day/year

Status
Not open for further replies.

CorrieLee

Programmer
Oct 13, 2004
18
CA
Hi there,

I was just wondering if there was a fast way to pull the year/month/day out of a flash date? Most languages have date functions like this, but I can't find anything in flash?


Thanks,
Corrie.
 
Try this out:

Code:
theDate = new Date();
myDate = theDate.getMonth() + "/" + theDate.getDate() + "/" + theDate.getFullYear();
trace(myDate);

Thing is it comes from the client computer, so you will only get a correct date if the date on the client is correct.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Thanks,

That sort of works, but the year is coming back as 104 ?

actualDate = "Mon Aug 16 00:00:00 GMT-0700 2004"
outputDate = "104-7-16"
Code:
StartConfirm_txt.text = tempStart.getYear() + "-" + tempStart.getMonth() + "-" + tempStart.getDate();

Any ideas?

Corrie
 
Has to be getFullYear(). (as in example) :)

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top