nuix time 을 Datetime 으로 변환하는 방법이다.
select dateadd(ss, 1482912960, '1970-01-01 09:00:00');
반대로, Datetime 을 nuix time으로 변환하는 방법이다.
select datediff(ss,'1970-01-01 09:00:00','2016-12-28 17:16:00');
보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.
nuix time 을 Datetime 으로 변환하는 방법이다.
select dateadd(ss, 1482912960, '1970-01-01 09:00:00');
반대로, Datetime 을 nuix time으로 변환하는 방법이다.
select datediff(ss,'1970-01-01 09:00:00','2016-12-28 17:16:00');
echo date("t", time()); //월 마지막일;
결과: 30
echo date("t", mktime(0, 0, 0, 11, 23, 2016)); //월 마지막일
결과: 30
정규식으로 특수문자를 체크한다.
$string="[aabb]";
$result = preg_match("/[ #\&\+\-%@=\/\\\:;,\.'\"\^`~\_|\!\?\*$#<>()\[\]\{\}]/i", $string);
if($result == true)
{
echo "특수문자 있음";
}
else
{
echo "특수문자 없음";
}
추출한 데이터에서 원하는 데이터만 가져오고 싶을때 정규식을 이용해서 가져오면 간단하게 해결된다.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace ConsoleApplication1
{
class Program
{
// 정규식
const string _RegTxt = "<strong>(?<entry>.*?)</strong>";
static void Main(string[] args)
{
//추출한 문자
String txt = "<html><body><strong>문자</strong></body></html>";
Console.WriteLine("result : {0}", getRegText(txt, _RegTxt));
}
/// <summary>
/// 문자 추출하기
/// </summary>
/// <param name="txt">추출한 문자</param>
/// <param name="txtRegx">정규식</param>
/// <returns></returns>
public static string getRegText(string txt, string txtRegx)
{
Group g = null;
string result=null;
Regex reg = new Regex(txtRegx, RegexOptions.IgnoreCase | RegexOptions.Singleline);
MatchCollection resultColl = reg.Matches(txt);
foreach (Match mm in resultColl)
{
g = mm.Groups[1];
result = mm.Groups["entry"].ToString();
}
return result;
}
}
}
unixtime을 Data()형식으로 변경하기
select from_unixtime(unix_timestamp(),'%Y%m%d')
1. 윈도우 실행창에 netplwiz 입력하고 엔터
2. 사용자 계정 팝업 창에서 [사용자 이름과 암호를 입력해야 이 컴퓨터를 사용할 수 있음] 체크 해제 후 적용
3. 비밀번호 입력 하면 끝.
같은 경로인데 파일 리스트가 다르게 보이네요.
왜 그런걸까요?
익스플로러상단 메뉴 도구 > 인터넷옵션 > 설정 > 파일보기 에서 확인되는 파일 리스트
탐색기로 해당 폴더 접근했을 때 파일 리스트
var jScript = document.createElement("script");
jScript.src = "경로/파일명.js";
document.head.appendChild(jScript);