You can do this by using running GetSpellCooldown() on a spell that has no cooldown and is on the GCD. This should work, just make sure you replace Moonfire with the name of an appropriate reference spell for whatever class you're playing. Hit the macro while you're in a GCD and it'll tell you how long the GCD is.
Code:
/script local _,gcd=GetSpellCooldown("Moonfire"); print("Current global cooldown is "..gcd.." seconds.")
It's also not very difficult to calculate it by dividing 1.5 by your % haste + 1, as (I think) lawomous was trying to point out.