Can you post what is your time format within a file?
Maybe you can use [man]strtotime[/man] instead of mktime, as the first one recognizes
about any English textual datetime description
as the manual says, which, I suppose, includes am and pm in 12 hours time.