For example, I would be able to type a function like so:
echo findtimeinworld('<some way to format Sydney, Australia>'); // The current time in Sydney, Australia in a timestamp
How would such a function be possible?
Also, please note I’m working on a hosted server here, so the server time may be anything.
Bonus votes for the smallest possible function.
You’re going to need a database containing time zone information for every city that is to be queried, and then make a time zone adjustment to your current server time.
There is a Time Zone database located here. It looks like it comes with some C code to dump the time zone information to a file that, hopefully, is importable to a database table. Once you have that, you should be able to get a time zone adjustment for any city in the world, at any time of the year.