Studying dualities in gauge theory we develop a new formalism which assumes the Lagrangian density, and hence also the action, depends explicitly on space-time. We first develop our formalism to study electro-magnetic duality. Starting from Lagrangian field theory and the variational principle, we show that duality in the equations of motion can also be obtained by introducing explicit spacetime dependence into the Lagrangian. Poincare invariance is achieved precisely when the duality conditions are satisfied, in a particular way. The analysis and resulting criteria, are valid for both Abelian and non-Abelian dualities. We illustrate how the Dirac string solution, Dirac quantisation condition, t?Hooft-Polyakov monopole solutions are recovered, and further show that a systematic procedure emerges for obtaining new classical solutions of Yang-Mills theory. Moreover, these results occur in a way that is strongly reminiscent of the holographic principle. We use our formalism to study weak-strong duality in the equivalence of the Sine Gordon-Massive Thirring models. Further we apply the formalism to the action relevant for general relativity to obtain a Barriola-Vilenkin type solution.