Refractoring for convertDate()
Add exclusive write lock to WriteToCache()