These are some good methods for working with the dates.
today(); //Returns the current date
321, // sequence of date parts 3=year 2=month 1=day
DateSeparator::Hyphen, // separator1
DateSeparator::Hyphen, // separator2
str2Date("2011-06-30",321) // turns the string into a date
mthofyr(today()) //returns the current month as a integer.
year(today()) //returns the current year as a integer.
dayofmth(today()) //returns the dat as a integer.
If you are working UTCDates that was introduces in AX 2009 there is a class called DateTimeUtil that contains all the functions that is needed. For utcdates use datetimeutil::utcNow() instead of today()
Records that are displayed in ax without a date are stored in the database as 1900-01-01.