Dear Ankit,
Looking at format.php of the weeks format it appears to be stored in the standard unix number of seconds since the 1st January 1970 format. Therefore older dates will have a lower value than more recent dates.
This can be deduced from the calculations performed using the current time and the course start date along with the formatting applied with the userdate function in moodlelib.php utilising the formatting string 'strftimedateshort' fetched by the function get_string.
I hope this helps.
Cheers,
Gareth
Courses and course formats
date based sorting of courses in moodle
This discussion has been locked so you can no longer reply to it.