Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Need to convert datetime containg '/' to '-' format
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 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 String dtApprovedAt = "10/23/2018 2:33:18 AM"; DateTime parsedDate = DateTime.ParseExact(dtApprovedAt.ToString(), "M/dd/yyyy h:mm:ss tt", System.Globalization.CultureInfo.InvariantCulture); String parsedStr = parsedDate.ToString("MM-dd-yyyy hh:mm").ToString(); Console.WriteLine(parsedStr); ; } } }
run
|
edit
|
history
|
help
1
Invoke method via reflection
Single Line Date in Months
SortRank
MonitorPulse.cs
c# abstract
Test Stopwatch
Ejemplos polimorfismos con interfaces y posibles usos sencillos c#
Get Round of 5 c# Vishal
7. Asynchrony
Operator Overloading + Operator