Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Valida Fechas futuras
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine("Hello, world!"); String fecha_input = "01-07-2020"; DateTime fecha_input_date = DateTime.ParseExact(fecha_input,"dd-MM-yyyy",System.Globalization.CultureInfo.InvariantCulture); DateTime fecha_hoy = DateTime.Now; if((fecha_hoy.Month == fecha_input_date.Month) && (fecha_hoy.Year == fecha_input_date.Year)){ Console.WriteLine("la solicitud se procesara correctamente, corresponde a fecha dentro del mismo mes actual"); }else{ Console.WriteLine("la solicitud no se podra procesar ya que la fecha inicio no esta considerada dentro del mes actual"); } // Vence contrato 30-06-2020 // si (fecha inicio es 01 - mes.actual + 1 - 2020 <> fecha fin es 01 - mes.actual + 1 - 2020) and (fecha inicio es 01 - mes.year - 2020 <> fecha fin es 01 - mes.year - 2020) Console.WriteLine(new DateTime(fecha_hoy.Year,fecha_hoy.Month,1).AddDays(-1)); Console.WriteLine(new DateTime(fecha_hoy.Year,fecha_hoy.Month,1).AddMonths(1).AddDays(-1)); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Byte array to base 64 string
Singletone Class
line 1 syntax error
Pruebas
Write a program to count the occurrence of each distinct item in the array?
Collections
Boo socks
AdventCode
linked list (add to end and beginning, and looking for cycles based on Floyd's algorithm)
Using System.Reflection to find Property Name and Value of any Generic Class
stackse - search stackoverflow differently
Please log in to post a comment.