Welcome to mirror list, hosted at ThFree Co, Russian Federation.

debugger-datetime-test.cs « debugger « tests « wasm « sdks - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 62890a7c0ff884b592267d2194d4d78375ce62a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Globalization;
namespace DebuggerTests
{
    public class DateTimeTest
    {
        public static string LocaleTest(string locale)
        {
            CultureInfo.CurrentCulture = new CultureInfo(locale, false);
            Console.WriteLine("CurrentCulture is {0}", CultureInfo.CurrentCulture.Name);

            DateTimeFormatInfo dtfi = CultureInfo.GetCultureInfo(locale).DateTimeFormat;
            var fdtp = dtfi.FullDateTimePattern;
            var ldp = dtfi.LongDatePattern;
            var ltp = dtfi.LongTimePattern;
            var sdp = dtfi.ShortDatePattern;
            var stp = dtfi.ShortTimePattern;

            DateTime dt = new DateTime(2020, 1, 2, 3, 4, 5);
            string dt_str = dt.ToString();
            Console.WriteLine("Current time is {0}", dt_str);

            return dt_str;
        }
    }
}