In my application users can select a culture in their profile, for this example I am testing with the Japanese ("ja") culture.
I use moment.js to generate date time string on the client side but, there are other palces where I generate the date time string on the server with C#.
Using moment.js i use code like this - var now = new moment(); now.format('L') + " " + now.format('LT');
And on the server I set the Thread current culture and then convert it to a string. Thread.CurrentThread.CurrentCulture = myCulture; DateTime.Now.ToString()
These are the results
Moment -
2017/07/10 午後3時57分
C#
2017/07/10 15:57:13
No matter what parameters I try to pass to the ToString
method I can't get it producing the same output as the moment client side library. For example passing in "F" produces the following output
2017年7月10日 15:57:13
Is there a simple way to duplicate how moment generates the date time string in .net?