본문 바로가기

Datetime

(4)
[mssql] convert yyyyMMddhhmmss string to datetime DECLARE @stringDatetime CHAR(14) = '20160823160000' -- yyyyMMddhhmmss DECLARE @convertedDatetime DATETIME = NULL SELECT @convertedDatetime = CAST((SUBSTRING(@stringDatetime,1,4) + '-' + SUBSTRING(@stringDatetime,5,2) + '-' + SUBSTRING(@stringDatetime,7,2) + ' ' + SUBSTRING(@stringDatetime,9,2) + ':' + SUBSTRING(@stringDatetime,11,2) + ':' + SUBSTRING(@stringDatetime,13,2)) AS DATETIME) SELECT @c..
[mssql] CONVERT Datatime to string DECLARE @index INT = 100 DECLARE @result VARCHAR(30) WHILE @index < 132 BEGIN BEGIN TRY SET @result = CONVERT(VARCHAR(30), GETDATE(), @index) PRINT convert(char(3), @index) + ', ' + @result END TRY BEGIN CATCH print convert(char(3), @index) + ', ' + 'NOT_CONVERTED' END CATCH SET @index = @index + 1 END 100, 06 26 2017 6:33PM 101, 06/26/2017 102, 2017.06.26 103, 26/06/2017 104, 26.06.2017 105, 26..
[c#] 경과 시간을 표시할 때 String saveTempString = string.empty;DateTime tempDateTime = DateTime.Now; // 시작하는 위치 ... 처리 로직 TimeSpan diff = DateTime.Now - tempDateTime; saveTempString = string.Format("{0:hh\\:mm\\:ss}", diff); Console.WriteLine(saveTempString);
[jsgrid] json datetime column convert to javascript datetime on with custum format var defaultFields = [ { name: "Title", type: "text", width: "", title: "용어명", css: "text-left col-md-9 col-sm-9 col-xs-9" }, { name: "RegisterId", type: "text", width: "", title: "등록자", css: "text-center col-md-1 col-sm-1 col-xs-1" }, { name: "RegistDate", type: "date", width: "", title: "등록일시", css: "text-center col-md-1 col-sm-1 col-xs-1" }, { name: "UseYn", type: "text", width: "", title: "사용..