본문 바로가기

convert

(5)
[javascript] get parameters to object var _param = {}; _param.data = null; _param.init = function () { _param.data = _param.ToConvert(); console.log('_param.data : ' + JSON.stringify(_param.data)); } _param.ToConvert = function () { var pairs = location.search.slice(1).split('&'); var result = {}; pairs.forEach(function (pair) { pair = pair.split('='); result[pair[0]] = decodeURIComponent(pair[1] || ''); }); return JSON.parse(JSON.s..
[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..
Convert string format to Datetime string testDateString = "19900712"; DateTime testDatetime = DateTime.ParseExact(testDateString, "yyyyMMdd"); string resultDateString = string.Format("{0:yyyy년MM월dd일}", testDatetime); msdn : https://goo.gl/kLdZ9k
[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..
[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: "사용..