A gradient DC magnet is designed using 3D magnetic field analysis code. This magnet, referred to as a B0 magnet, is one of the key elements of a time-focusing device for ultra-cold neutrons (UCNs) based on a radio frequency gradient flipper – a so-called rebuncher. The magnet generates a guide and a potential field that interacts with the magnetic moment of UCNs and its main body comprises a C-shaped yoke made from iron. A field gradient is generated by a pole arrangement that includes an anisotropic inter-pole, which causes the fringe field to be uniform in the longitudinal direction even when the pole gap distance changes. The designed magnet has the following properties: (1) a maximum B-field of 10 kGauss, decreasing to 2 kGauss at a longitudinal distance of 25cm, with a gradient of less than 400 Gauss/cm, (2) variations in the fringe field along the y direction is less than 4% over a range of−3cm≤ y ≤ 3cm at any z position in the spin-flipping region. Tracking simulations show that the B0 magnet is capable of accepting UCNs in the velocity range 2.3∼3.3 m/s.