How do I change the time to 24 hours?

Well, open dconf-editor. It shows some hierarchical settings structure. Just navigate to com/canonical/indicator/datetime/time-format entry.