We report a novel relation between rotation and magnetic field in a charged fluid system: there is naturally a magnetic field along the direction of fluid vorticity due to the currents associated with the swirling charges. This general connection is demonstrated using a fluid vortex. Applying the idea to heavy ion collisions we propose a new mechanism for generating in-medium magnetic field with a relatively long lifetime. We estimate the magnitude of this new magnetic field in the Au-Au colliding systems across a wide span of collisional beam energy. Such a magnetic field is found to increase rapidly toward lower beam energy and could account for a significant amount of the experimentally observed global polarization difference between hyperons and anti-hyperons.