본문 바로가기

Programming279

LocalDateTime,TimeStamp 이용 timestamp 값 얻기 (new Date()).getTime() 이 Deprecate 상태 여서 다른 방법을 찾아 보았습니다. module-info.java /** * */ module TestConsole { requires java.sql; } TestCls.java package com.test; import java.time.LocalDateTime; import java.sql.Timestamp; public class TestCls { public static void main(String[] args) { LocalDateTime localDateTime = LocalDateTime.now(); Timestamp timeStamp = Timestamp.valueOf(localDateTime); long lNow =.. 2023. 7. 3.
Ubuntu 20.04.5 TimeZone 변경 방안 출처 : Linux : Ubuntu 20.04 : Timezone 설정, 변경 방법, 예제, 명령어 (tistory.com) Linux : Ubuntu 20.04 : Timezone 설정, 변경 방법, 예제, 명령어 많은 시스템 관련 작업 및 프로세스에는 정확한 시간대를 사용하는 것이 필수적입니다. 예를 들어, 크론 대몬은 크론 작업을 실행하기 위해 시스템의 시간대를 사용하고 로그 파일의 타임스탬 jjeongil.tistory.com Ubuntu GUI 에서는 설정을 변경 할 수 없어 출처의 내용 과 같이 UTC 기준에서 Asia/Seoul로 변경 시도를 하였습니다. $ timedatectl Local time: Mon 2023-07-03 08:05:33 UTC Universal time: Mon 202.. 2023. 7. 3.
[MFC] Windows Service 시작 / 중지 상태 확인 제어 예제 아래는 Windows Printer Spooler ( spooler ) 서비스 시작 중지 예제 입니다. if (bResult == TRUE) { StopSpooler(); Sleep(2000); StartSpooler(); } BOOL StopSpooler() { SC_HANDLE schService; SC_HANDLE schSCManager; // Machine NULL=local , database NULL= default schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); if (!schSCManager) { Log(L"%s OpenSCMManager 함수 호출이 실패 하였습니다. GetLastError=%d", __FUNCTIONW__, .. 2023. 6. 27.
RegOpenKeyEx 32bit 응용프로그램에서 64bit Registry 접근 예제 출처 : winapi - C++ read a Registry entry in SOFTWARE\WOW6432 from a 64-bit app - Stack Overflow 2023. 6. 22.