public static void PrintDate()
 => System.Console.WriteLine(Today.ToShortDateString());
Пример #2
0
 public static void PrintDate()
 {
     WriteLine(Today.ToShortDateString());
 }
Пример #3
0
        public DateService()
        {
            if (System.IO.File.Exists(_currentDateFilePath))
            {
                _currentDateFile    = XDocument.Load(_currentDateFilePath);
                _currentDateElement = _currentDateFile.Descendants(_currentDateTagName).First();
                Today = DateTime.Parse(_currentDateElement.Value);
            }
            else
            {
                Today            = DateTime.Today;
                _currentDateFile = new XDocument(new XElement("SystemInfo",
                                                              new XElement(_currentDateTagName, Today.ToShortDateString())));

                _currentDateFile.Save(_currentDateFilePath);
            }
        }