public static string DataAtual(FormatoDataEnum FormatoDeData) { var formato = FormatoData.ObterFormatoData(FormatoDeData); DateTime DataAtual = DateTime.Now; return(DataAtual.ToString(formato.Value)); }
public static String FormatarData(FormatoDataEnum FormatoDeData, DateTime data) { if (Utilitarios.VerificarObjetoValido(FormatoDeData)) { var formato = FormatoData.ObterFormatoData(FormatoDeData); var anoAnterior = new DateTime(data.Year, data.Month, data.Day); return(anoAnterior.ToString(formato.Value)); } return(""); }