Advertisement
lelesape

formatDate

Aug 14th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Programación_2
  4. {
  5.     class Program
  6.     {
  7.         //
  8.         // Integrantes: Bruno Arnuti, Leandro Alfonso, Felipe Cabrera, Alvaro Machado, Sonia Olivera.
  9.         //
  10.  
  11.         private static string FormatDate(string prevDate)
  12.         {
  13.             return prevDate.Substring(6)+"-"+prevDate.Substring(3, 2)+"-"+prevDate.Substring(0, 2);
  14.         }
  15.  
  16.         static void Main(string[] args)
  17.         {
  18.             string testDate = "10/12/1978";
  19.             Console.WriteLine(testDate+" se veria como "+FormatDate(testDate));
  20.         }
  21.     }
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement