Last active
April 9, 2020 13:10
-
-
Save ashour/e221f42b1c137a477d438722f6837783 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
class MainClass | |
{ | |
public static void Main (string[] args) | |
{ | |
var dateTime1 = new DateTime(1970, 1, 1, 0, 0, 0); | |
var dateTime2 = new DateTime(2020, 4, 1, 13, 30, 22, 500); | |
TimeSpan span = dateTime2 - dateTime1; | |
Console.WriteLine(span.ToString("G", new CultureInfo("en-US"))); | |
// => 18353:13:30:22.5000000 | |
Console.WriteLine(span.ToString("G", new CultureInfo("fr-FR"))); | |
// => 18353:13:30:22,5000000 | |
Console.WriteLine(span.ToString("G", new CultureInfo("ml-IN"))); | |
// => 18353:13:30:22.5000000 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment