시스템 시간
컴퓨터 과학과 컴퓨터 프로그래밍에서 시스템 시간(system time)은 시간의 흐름에 따른 컴퓨터 시스템의 개념을 말한다. 이같은 문맥에서 시간은 달력의 일수가 경과하는 것도 포함한다.
![](http://upload.wikimedia.org/wikipedia/commons/2/2d/System-Time.png)
시스템 시간은 시스템 클록에 의해 측정되며, 이는 일반적으로 기원일이라 부르는 특정한 시작일 이래로 발생된, 틱(tick)의 수를 단순히 세는 것으로 구현된다. 이를테면 유닉스와 POSIX 호환 시스템들은 시스템 시간(유닉스 시간)을 윤초를 제외하고 1 January 1970 00:00:00 UT의 유닉스 시간 시작점 이후로 경과한 초 단위의 수로 인코딩한다. 윈도우 9x, 윈도우 NT와 같이 32비트와 64비트 버전의 윈도우 API를 구현하는 시스템들은 연도/월/일/시간/분/초/밀리초 값을 대표하는 SYSTEMTIME
과 1 January 1601 00:00:00 UT 이후의 100 나노초의 틱의 수를 세는 FILETIME
을 시스템 시간으로 둘 다 제공한다.
시스템 시간은 날짜 시간으로 변환할 수 있으며, 이는 인간이 이해하기에 더 적합한 형태이다.
역사
편집대부분의 1세대 PC들은 날짜와 시간을 추적하지 못했다. 여기에는 CP/M 운영 체제를 구동하던 시스템뿐 아니라 초기 모델의 애플 II, BBC 마이크로, 코모도어 PET도 포함되었다. IBM PC/AT은 메인보드에 날짜/시간 하드웨어가 장착된 최초의 상용화된 개인용 컴퓨터였다. 온보드 배터리 백업이 있는 실시간 시계 칩이 포함된 애드온 주변 기판이 IBM PC와 XT용으로 이용이 가능하게 되었다. 컴퓨터 네트워크가 널리 사용할 수 있기 전까지 시스템 시간을 추적하였던 대부분의 개인용 컴퓨터 시스템들은 오직 로컬 시간과만 관계를 맺었고 시간대에 대한 허용을 두지 않았다.
시스템 시간의 반환
편집운영 체제
편집운영 체제 | 명령어 또는 함수 | 해상도 | 기원 또는 범위 |
---|---|---|---|
안드로이드 | java.lang
|
1 ms | 1 January 1970 |
바이오스 (IBM PC) | INT 1Ah, AH=00h [1]
|
54.931 ms 18.204 Hz |
Midnight of the current day |
INT 1Ah, AH=02h [2]
|
1 s | Midnight of the current day | |
INT 1Ah, AH=04h [3]
|
1 day | 1 January 1980 to 31 December 1999 or 31 December 2079 (system dependent) | |
CP/M | System Control Block:[4]scb$base+58h , Days since 1 Jan 1978scb$base+5Ah , Hour (BCD)scb$base+5Bh , Minute (BCD)scb$base+5Ch , Second (BCD) |
1 s | 1 January 1978 to September 2067 |
BDOS function 69h (T_GET ):[5]word , Days since 1 January 1978byte , Hour (BCD)byte , Minute (BCD)byte , Second (BCD)
| |||
도스 (마이크로소프트) | C:\>DATE
|
10 ms | 1 January 1980 to 31 December 2099 |
INT 21h, AH=2Ch SYSTEM TIME [6]INT 21h, AH=2Ah SYSTEM DATE [7]
| |||
iOS (애플) | CFAbsoluteTimeGetCurrent() [8]
|
< 1 ms | 1 January 2001 ±10,000 years |
맥 OS (애플) | CFAbsoluteTimeGetCurrent() [9]
|
< 1 ms[10][note 1] | 1 January 2001 ±10,000 years[10][note 1] |
OpenVMS (HP) | SYS$GETTIM()
|
100 ns | 17 November 1858 to AD 31,086 |
Z/OS (IBM) | STCK [11]
|
2−12 μs 244.14 ps[12] |
1 January 1900 to 17 September 2042 UT[13] |
유닉스, POSIX (see also Time.h) |
$date Time.h
|
1 s | (*) 1 January 1970 to 19 January 2038 1 January 1970 to AD 292,277,026,596 |
|
1 μs | ||
|
1 ns | ||
윈도우 (마이크로소프트) | GetSystemTime()
|
1 ms | 1 January 1601 to AD 30,828 |
GetSystemTimeAsFileTime()
|
100 ns |
프로그래밍 언어 및 응용 프로그램
편집언어/응용 프로그램 | 함수 또는 변수 | 해상도 | 기원 또는 범위 |
---|---|---|---|
Ada | Ada.Calendar.Clock
|
100 μs to 20 ms (*) |
1 January 1901 to 31 December 2099 (*) |
AWK | systime()
|
1 s | (*) |
베이직, en:True BASIC | DATE , DATE$ TIME , TIME$
|
1 s | (*) |
비즈니스 베이직 | DAY , TIM
|
0.1 s | (*) |
C (see Time.h) | Time.h
|
1 s (*)[note 2] | (*)[note 2] |
C++ | std::time() std::chrono::system_clock::now()
|
1 s (*)[note 2] 1 ns (C++11, OS dependent) |
(*)[note 2] |
C# (마이크로소프트) | System.DateTime.Now [14]System.DateTime.UtcNow [15]
|
100 ns[16] | 1 January 0001 to 31 December 9999 |
CICS (IBM) | ASKTIME
|
1 ms | 1 January 1900 |
코볼 | FUNCTION CURRENT-DATE
|
1 s | 1 January 1601 |
커먼 리스프 | (get-universal-time)
|
1 s | 1 January 1900 |
Delphi (볼랜드) | date time
|
1 ms (부동소수점) |
1 January 1900 |
Delphi (엠바카데로 테크놀로지스)[17] |
System.SysUtils.Time [18]
|
1 ms | 0/0/0000 0:0:0:000 to 12/31/9999 23:59:59:999 [sic] |
System.SysUtils.GetTime [19] (alias for System.SysUtils.Time )
| |||
System.SysUtils.Date [20]
|
0/0/0000 0:0:0:000 to 12/31/9999 0:0:0:000 [sic] | ||
System.DateUtils.Today [21]
| |||
System.DateUtils.Tomorrow [22]
| |||
System.DateUtils.Yesterday [23]
| |||
System.SysUtils.Now [24]
|
1 s | 0/0/0000 0:0:0:000 to 12/31/9999 23:59:59:000 [sic] | |
System.SysUtils.DayOfWeek [25]
|
1 day | 1 to 7 | |
System.SysUtils.CurrentYear [26]
|
1 year | (*) | |
en:Emacs Lisp | (current-time)
|
1 μs (*) | 1 January 1970 |
Erlang (에릭슨) | erlang:system_time() , os:system_time() [27]
|
OS dependent, e.g. on 리눅스 1ns[27] | 1 January 1970[27] |
Excel (마이크로소프트) | date()
|
? | 0 January 1900[28] |
포트란 | DATE_AND_TIME SYSTEM_CLOCK
|
(*)[29] | 1 January 1970 |
CPU_TIME
|
1 μs | ||
Go | time.Now()
|
1 ns | 1 January 0001 |
하스켈 | Time.getClockTime
|
1 ps (*) | 1 January 1970 (*) |
Data.Time.getCurrentTime
|
1 ps (*) | 17 November 1858 (*) | |
Java (Sun) | java.util.Date() System.currentTimeMillis()
|
1 ms | 1 January 1970 |
System.nanoTime() [31]
|
1 ns | arbitrary[31] | |
Clock.systemUTC() [32]
|
1 ns | arbitrary[33] | |
자바스크립트 | (new Date()).getTime() Date.now()
|
1 ms | 1 January 1970 |
MATLAB | now
|
1 s | 0 January 0000[34] |
en:MUMPS | $H (short for $HOROLOG )
|
1 s | 31 December 1840 |
LabVIEW | Tick Count
|
1 ms | 00:00:00.000 1 January 1904 |
Get Date/Time in Seconds
|
1 ms | 00:00:00.000 1 January 1904 | |
오브젝티브-C | [NSDate timeIntervalSinceReferenceDate]
|
< 1 ms[35] | 1 January 2001 ±10,000 Years[35] |
OCaml | Unix.time()
|
1 s | 1 January 1970 |
Unix.gettimeofday()
|
1 μs | ||
Extended Pascal | GetTimeStamp()
|
1 s | (*) |
터보 파스칼 | GetTime() GetDate()
|
10 ms | (*) |
펄 | time()
|
1 s | 1 January 1970 |
Time::HiRes::time [36]
|
1 μs | ||
PHP | time() mktime()
|
1 s | 1 January 1970 |
microtime()
|
1 μs | ||
파이썬 | datetime.now().timestamp()
|
1 μs (*) | 1 January 1970 |
RPG | CURRENT(DATE) , %DATE CURRENT(TIME) , %TIME
|
1 s | 1 January 0001 to 31 December 9999 |
CURRENT(TIMESTAMP) , %TIMESTAMP
|
1 μs | ||
루비 | Time.now() [37]
|
1 μs (*) | 1 January 1970 (to 19 January 2038 prior to Ruby 1.9.2[38]) |
스몰토크 | Time microsecondClock (VisualWorks) |
1 s (ANSI) 1 μs (VisualWorks) 1 s (Squeak) |
1 January 1901 (*) |
Time totalSeconds (Squeak) | |||
SystemClock ticksNowSinceSystemClockEpoch (Chronos) | |||
SQL | CURDATE() CURTIME() GETDATE() NOW() SYSDATE()
|
3 ms | 1 January 1753 to 31 December 9999 (*) |
60 s | 1 January 1900 to 6 June 2079 | ||
en:Standard ML | Time.now()
|
1 μs (*) | 1 January 1970 (*) |
TCL | [clock seconds]
|
1 s | 1 January 1970 |
[clock milliseconds]
|
1 ms | ||
[clock microseconds]
|
1 μs | ||
[clock clicks]
|
1 μs (*) | (*) | |
윈도우 파워셸 | Get-Date [39][40]
|
100 ns[16] | 1 January 0001 to 31 December 9999 |
[DateTime]::Now [14][DateTime]::UtcNow [15]
| |||
비주얼 베이직 닷넷 (마이크로소프트) | System.DateTime.Now [14]System.DateTime.UtcNow [15]
|
100 ns[16] | 1 January 0001 to 31 December 9999 |
같이 보기
편집내용주
편집- ↑ 가 나 The Apple Developer Documentation is not clear on the precision & range of CFAbsoluteTime/CFTimeInterval, except in the CFRunLoopTimerCreate documentation which refers to 'sub-millisecond at most' precision. However, the similar type NSTimeInterval appears to be interchangeable, and has the precision and range listed.
- ↑ 가 나 다 라 The C 표준 라이브러리 does not specify any specific resolution, epoch, range, or datatype for system time values. The C++ library encompasses the C library, so it uses the same system time implementation as C.
각주
편집- ↑ Ralf Brown, "Int 0x1A, AH=0x00" in 랄프 브라운의 인터럽트 리스트, 2000, http://www.delorie.com/djgpp/doc/rbinter/ix/1A/00.html
- ↑ Ralf Brown, "Int 0x1A, AH=0x02" in 랄프 브라운의 인터럽트 리스트, 2000, http://www.delorie.com/djgpp/doc/rbinter/ix/1A/02.html
- ↑ Ralf Brown, "Int 0x1A, AH=0x04" in 랄프 브라운의 인터럽트 리스트, 2000, http://www.delorie.com/djgpp/doc/rbinter/ix/1A/04.html
- ↑ “CP/M Plus (CP/M Version 3.0) Operating System Guide” (PDF).
- ↑ “BDOS system calls”.
- ↑ Ralf Brown, "Int 0x21, AH=0x2c" in 랄프 브라운의 인터럽트 리스트, 2000, http://www.delorie.com/djgpp/doc/rbinter/ix/21/2C.html
- ↑ Ralf Brown, "Int 0x21, AH=0x2a" in 랄프 브라운의 인터럽트 리스트, 2000, http://www.delorie.com/djgpp/doc/rbinter/ix/21/2A.html
- ↑ "Time Utilities Reference" in iOS Developer Library (Apple, 2007).
- ↑ "Time Utilities Reference" in Mac OS X Developer Library (Apple, 2007).
- ↑ 가 나 "CFRunLoopTimer Reference" in Mac OS X Developer Library (Apple, 2007).
- ↑ z/Architecture Principles of Operation (Poughkeepsie, New York:International Business Machines, 2007) 7-187.
- ↑ z/Architecture Principles of Operation, (Poughkeepsie, New York:International Business Machines, 2000) 4-45, 4-46.
- ↑ IBM intends to extend the date range on future systems beyond 2042. z/Architecture Principles of Operation, (Poughkeepsie, New York:International Business Machines, 2007) 1-15, 4-45 to 4-47.
- ↑ 가 나 다 "DateTime.Now Property" in 마이크로소프트 개발자 네트워크 (Microsoft, 2010) last updated July 2010.
- ↑ 가 나 다 "DateTime.UtcNow Property" in MSDN (Microsoft, 2011)
- ↑ 가 나 다 "DateTime.Ticks Property in MSDN (Microsoft, 2010) last updated May 2010.
- ↑ "Date and Time Support" Archived 2018년 1월 9일 - 웨이백 머신 in Embarcadero Developer Network (Embarcadero Technologies, 2013)
- ↑ "System.SysUtils.Time" Archived 2014년 4월 5일 - 웨이백 머신 in Embarcadero Developer Network (Embarcadero Technologies, 2013)
- ↑ "System.SysUtils.GetTime" Archived 2014년 4월 5일 - 웨이백 머신 in Embarcadero Developer Network (Embarcadero Technologies, 2013)
- ↑ "System.SysUtils.Date" Archived 2014년 4월 5일 - 웨이백 머신 in Embarcadero Developer Network (Embarcadero Technologies, 2013)
- ↑ "System.DateUtils.Today" Archived 2014년 4월 5일 - 웨이백 머신 in Embarcadero Developer Network (Embarcadero Technologies, 2013)
- ↑ "System.DateUtils.Tomorrow" Archived 2014년 4월 5일 - 웨이백 머신 in Embarcadero Developer Network (Embarcadero Technologies, 2013)
- ↑ "System.DateUtils.Yesterday" Archived 2014년 4월 5일 - 웨이백 머신 in Embarcadero Developer Network (Embarcadero Technologies, 2013)
- ↑ "System.SysUtils.Now" Archived 2014년 5월 3일 - 웨이백 머신 in Embarcadero Developer Network (Embarcadero Technologies, 2013)
- ↑ "System.SysUtils.DayOfWeek" Archived 2014년 4월 5일 - 웨이백 머신 in Embarcadero Developer Network (Embarcadero Technologies, 2013)
- ↑ "System.SysUtils.CurrentYear" Archived 2014년 4월 5일 - 웨이백 머신 in Embarcadero Developer Network (Embarcadero Technologies, 2013)
- ↑ 가 나 다 Time and Time Correction in Erlang
- ↑ "In the Microsoft Office Spreadsheet Component, the value 0 evaluates to the date December 30, 1899 and the value 1 evaluates to December 31, 1899. ... In Excel, the value 0 evaluates to January 0, 1900 and the value 1 evaluates to January 1, 1900." XL2000: Early Dates on Office Spreadsheet Component Differ from Excel in (Microsoft Support, 2003).
- ↑ "SYSTEM_CLOCK", documentation for FORTRAN compiler, Intel Corp., accessed 27 October 2011.
- ↑ SYSTEM_CLOCK - Time function" in The GNU Fortran Compiler (Free Software Foundation) accessed 27 October 2011.
- ↑ 가 나 System.nanoTime() method in Java Platform, Standard Edition 6: API Specification (Oracle, 2011) accessed 27 October 2011.
- ↑ Clock.systemUTC() and other methods in Java Platform, Standard Edition 8: API Specification (Oracle, 2014) accessed 15 January 2015.
- ↑ JSR-310 Java Time System in Java Platform, Standard Edition 8: API Specification (Oracle, 2014) accessed 15 January 2015.
- ↑ [1] Matlab Help
- ↑ 가 나 "Foundation Data Types Reference" in Mac OS X Developer Library (Apple, 2011) last modified 6 July 2011, section NSTimeInterval.
- ↑ Douglas Wegscheild, R. Schertler, and Jarkko Hietaniemi, "Time::HiRes" (CPAN Comprehensive Perl Archive Network, 2011) accessed 27 October 2011.
- ↑ Time class in Ruby-Doc.org: Help and documentation for the Ruby programming language (Scottsdale, AZ: James Britt and Neurogami) accessed 27 October 2011.
- ↑ Ruby 1.9.2 Release Notes Archived 2016년 9월 29일 - 웨이백 머신 in Ruby-Doc.org: Help and documentation for the Ruby programming language (Scottsdale, AZ: James Britt and Neurogami) accessed 27 October 2011.
- ↑ “Using the Get-Date Cmdlet”. Microsoft TechNet. 2013년 12월 11일에 확인함.
- ↑ “Windows PowerShell Tip of the Week - Formatting Dates and Times”. Microsoft TechNet. 2013년 12월 11일에 확인함.
외부 링크
편집- Critical and Significant Dates Archived 2016년 3월 15일 - 웨이백 머신, J. R. Stockton (retrieved 3 December 2015)
- The Boost Date/Time Library (C++)
- The Boost Chrono Library (C++)
- The Chronos Date/Time Library (Smalltalk)
- Joda Time, The Joda Date/Time Library (Java)
- The Perl DateTime Project Archived 2009년 2월 19일 - 웨이백 머신 (Perl)
- The Ruby Date/Time Library (Ruby)