Esempio n. 1
0
        public ActionResult <IClock> Get([FromQuery] string time)
        {
            try
            {
                if (time == null)
                {
                    time = DateTime.UtcNow.ToString("HH:mm:ss");
                }

                return(Ok(_timeConverter.ConvertTimeToBerlinClock(time)));
            }
            catch (Exception e)
            {
                _logger.LogError(e, "UtcTime conversion failed", time);

                return(BadRequest($"UtcTime conversion failed for '{time}'."
                                  + Environment.NewLine
                                  + "UtcTime should be supplied in HH:mm:ss format."));
            }
        }