The time and date will be pulled off the machine you run your script on. The simple way would be to figure out the time offsets from that location and check to see if it is AM or PM in your time zone.
So if you know where you are running your script on (say you live in eastern time zone in USA, then in western time zone, you subtract 3 hours (don't forget about the midnight/noon boundary)
Kerry Kobashi
Kobashi Computing