auto get date length