본문 바로가기

string

(5)
[c#][string.Join] 배열 요소 붙이기 .NET 4.0 이상 using System; using System.Data.Linq; using System.Collections.Generic; public class Program { public static void Main() { List tempArray = new List() { "LG선릉에클라트(A)", "LG선릉에클라트(B)", "래미안삼성1차", "래미안삼성1차(105)", "래미안삼성2차", "롯데", "롯데캐슬프레미어", "삼성동 롯데캐슬 킹덤", "삼성동중앙하이츠빌리지", "삼성동힐스테이트 1단지", "삼성파크", "상아", "서광아파트 101동, 102동", "석탑", "아이파크", "진흥", "청구", "풍림(1차)", "풍림(2차)", "한솔아파트 101동, 102동", "..
[javascript] JSON datetime string to javascript date format yyyy-MM-dd hh:mm:ss HTML js function formatDate(date) { var d = new Date(date), month = '' + (d.getMonth() + 1), day = '' + d.getDate(), year = d.getFullYear(), hour = d.getHours(), min = d.getMinutes(), sec = d.getSeconds(); if (month.length < 2) month = '0' + month; if (day.length < 2) day = '0' + day; return [year, month, day].join('-') + ' ' + [hour,min,sec].join(':'); } var dateText = "/Date(1519794794410)/"; ..
[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..