Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
Convert String to integer in c#
ReverseArrayC#
BCD16BitTest
Use ConcurrentQueue and ConcurrentDictionary with TPL (Simple example)
30272 Example2
W.I.P (c#)
Caelum
struc t
Riemann Sums
Simple Constructor Implementation
Please log in to post a comment.