Sistem saati

Vikipedi, özgür ansiklopedi

Unix tarih komutu

Bilgisayar bilimi ve bilgisayar programlamasında sistem zamanı, bir bilgisayar sisteminin zaman geçişi kavramını temsil eder. Bu anlamda, zaman, takvim üzerinde gün geçişi de içerir.

Sistem saati, bir çağrı adı verilen bazı keyfi başlangıç tarihlerinden bu yana gerçekleşen kenelerin sayısının basit bir sayımı olarak uygulanan bir sistem saatiyle ölçülür. For example, Unix and POSIX-compliant systems encode system time ("Unix time") as the number of seconds elapsed since the start of the Unix epoch at 1 January 1970 00:00:00 UT, with exceptions for leap seconds. Systems that implement the 32-bit and 64-bit versions of the Windows API, such as Windows 9x and Windows NT, provide the system time as both SYSTEMTIME, represented as a year/month/day/hour/minute/second/milliseconds value, and FILETIME, represented as a count of the number of 100-nanosecond ticks since 1 January 1601 00:00:00 UT as reckoned in the proleptic Gregorian calendar.

Sistem saati, insanların anlaması için daha uygun bir form olan takvim süresine dönüştürülebilir. Örneğin, çağın başlangıcından bu yana 1.000.000.000 saniyelik Unix sistem saati, 9 Eylül 2001 01:46:40 UT takvim süresine çevrilir. Bu tür işlemleri gerçekleştiren kitaplık altprogramları, saat dilimleri, gün ışığından yararlanma saati (DST), sıçrama saniyeleri ve kullanıcının yerel ayarları için yapılan ayarlamalarla da ilgilenebilir. Takvim zamanlarını sistem zamanlarına dönüştüren kitaplık rutinleri de genellikle sağlanmaktadır.

Diğer zaman ölçümleri[değiştir | kaynağı değiştir]

Sistem zamanı ile yakından ilişkili olan süreç zamanı, yürütmekte olan bir işlem tarafından tüketilen toplam işlemci saatinin bir sayısıdır. Sırasıyla, kullanıcı kodu ve sistem çekirdeği kodunu gerçekleştirmek için harcanan süreyi temsil eden kullanıcı ve sistem CPU süresine bölünebilir. İşlem süreleri, CPU talimatlarının veya saat çevrimlerinin bir toplamıdır ve genellikle duvar zamanı ile doğrudan bir bağıntıya sahip değildir.

Dosya sistemleri, her bir dosya ve dizinin dosya denetim bloğuna (veya inode'una) zaman damgalarını depolayarak, dosyaların oluşturulduğu, değiştirildiği ve / veya erişildiği süreleri tutar.

Uygulama[değiştir | kaynağı değiştir]

Sistem saati, periyodik olarak CPU'yu kesen ve daha sonra bir zamanlayıcı kesme servisi rutini yürütmeye başlayan programlanabilir bir zaman sayacı olarak uygulanır. Bu rutin sistem saatine bir kron ekler (basit bir sayaç) ve kesintiden önce CPU'nun yaptıklarına geri dönmeden önce diğer periyodik temizlik görevlerini (önleme vs.) gerçekleştirir.

Sistem zamanı alınıyor[değiştir | kaynağı değiştir]

05 Nisan 2024 21:32:17 UTC

Bu sayfa en son yenilendiğinde Vikipedi'nin sistem zamanı.
Önbelleği temizle

Aşağıdaki tablolar, çeşitli işletim sistemlerinde, programlama dillerinde ve uygulamalarda sistem saatini alma yöntemlerini göstermektedir. (*) Ile işaretlenmiş değerler sisteme bağlıdır ve uygulamalar arasında farklılık gösterebilir. Tüm tarihler Gregoryen veya Gregoryen takvimi olarak verilmiştir.

Bir uygulamanın zaman ölçümünün çözünürlüğünün bu ölçümlerin aynı doğruluğunu ima etmediğini unutmayın. Örneğin, bir sistem, geçerli saati mikrosaniye cinsinden ölçülen bir değer olarak geri getirebilir, ancak aslında sadece 100 Hz (10 ms) frekanslı tek tek saat işaretlerini ayırt edebilecek durumdadır.

İşletim sistemleri[değiştir | kaynağı değiştir]

İşletim sistemi Komut veya işlev Çözüm Çağ veya aralık
Android java.lang.System.currentTimeMillis() 1 ms 1 Aralık 1970
BIOS (IBM PC) INT 1Ah, AH=00h[1] 54.931 ms
18.204 Hz
Geçerli günün gece yarısı
INT 1Ah, AH=02h[2] 1 s Geçerli günün gece yarısı
INT 1Ah, AH=04h[3] 1 gün 1 Ocak 1980 - 31 Aralık 1999 veya 31 Aralık 2079 (sisteme bağlı)
CP/M Plus System Control Block:[4]
scb$base+58h, Days since 1 Jan 1978
scb$base+5Ah, Hour (BCD)
scb$base+5Bh, Minute (BCD)
scb$base+5Ch, Second (BCD)
1 s 1 Ocak 1978 - 20 Eylül 2067
BDOS function 69h (T_GET):[5]
word, Days since 1 January 1978
byte, Hour (BCD)
byte, Minute (BCD)
byte, Second (BCD)
DOS (Microsoft) Şablon:SampDATE
Şablon:SampTIME
10 ms 1 Ocak 1980 - 31 Aralık 2099
INT 21h, AH=2Ch SYSTEM TIME[6]
INT 21h, AH=2Ah SYSTEM DATE[7]
iOS (Apple) CFAbsoluteTimeGetCurrent()[8] < 1 ms 1 Ocak 2001 ±10,000 yıl
Mac OS (Apple) CFAbsoluteTimeGetCurrent()[9] < 1 ms[10][note 1] 1 Ocak 2001 ±10,000 yıl[10][note 1]
OpenVMS (HP) SYS$GETTIM() 100 ns 17 Kasım 1858'den AD 31.086'a
z/OS (IBM) STCK[11] 2−12 μs
244.14 ps[12]
1 Ocak 1900 - 17 Eylül 2042 UT[13]
Unix, POSIX
(ayrıca bakınız

C tarih ve saat işlevleri)

Şablon:Sampdate
time()
1 s (*)
1 Ocak 1970 t- 19 Ocak 2038
1 Ocak 1970 - AD 292,277,026,596
gettimeofday() 1 μs
clock_gettime() 1 ns
Windows (Microsoft) GetSystemTime() 1 ms 1 Ocak 1601 - AD 30,828
GetSystemTimeAsFileTime() 100 ns

Programlama dilleri ve uygulamaları[değiştir | kaynağı değiştir]

Dil / Uygulama İşlev veya değişken Çözüm Çağ veya aralık
Ada Ada.Calendar.Clock 100 μs to
20 ms (*)
1 Ocak 1901 - 31 Aralık 2099 (*)
AWK systime() 1 s (*)
BASIC, True BASIC DATE, DATE$
TIME, TIME$
1 s (*)
Business BASIC DAY, TIM 0.1 s (*)
C (see C date and time functions) time() 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# (Microsoft) System.DateTime.Now[14]
System.DateTime.UtcNow[15]
100 ns[16] 1 Ocak 0001 - 31 Aralık 9999
CICS (IBM) ASKTIME 1 ms 1 Ocak 1900
COBOL FUNCTION CURRENT-DATE 1 s 1 Ocak 1601
Common Lisp (get-universal-time) 1 s 1 Ocak 1900
Delphi (Borland) date
time
1 ms
(kayan nokta)
1 Ocak 1900
Delphi
(Embarcadero Technologies)[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/00000:0:0:000 - 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/00000:0:0:000 - 12/31/9999 23:59:59:000 [sic]
System.SysUtils.DayOfWeek[25] 1 gün 1 to 7
System.SysUtils.CurrentYear[26] 1 yıl (*)
Emacs Lisp (current-time) 1 μs (*) 1 Ocak 1970
Erlang (Ericsson) erlang:system_time()31 Temmuz 2017 tarihinde Wayback Machine sitesinde arşivlendi., os:system_time()13 Ağustos 2017 tarihinde Wayback Machine sitesinde arşivlendi.[27] OS bağımlı, e.g. on Linux 1ns[27] 1 Ocak 1970[27]
Excel (Microsoft) date() ? 0 Ocak 1900[28]
Fortran DATE_AND_TIME
SYSTEM_CLOCK
(*)[29]

[30]

1 Ocak 1970
CPU_TIME 1 μs
Go time.Now() 1 ns 1 Ocak 0001
Haskell Time.getClockTime 1 ps (*) 1 Ocak 1970 (*)
Data. Time.getCurrentTime 1 ps (*) 17 Kasım 1858 (*)
Java (Sun) java.util.Date()
System.currentTimeMillis()
1 ms 1 Ocak 1970
System.nanoTime()[31] 1 ns keyfi[31]
Clock.systemUTC()[32] 1 ns keyfi[33]
JavaScript (new Date()).getTime()
Date.now()
1 ms 1 Ocak 1970
Matlab now 1 s 0 Ocak 0000[34]
MUMPS $H (short for $HOROLOG) 1 s 31 Aralık 1840
LabVIEW Tick Count 1 ms 00:00:00.000 1 Ocak 1904
Get Date/Time in Seconds 1 ms 00:00:00.000 1 Ocak 1904
Objective-C [NSDate timeIntervalSinceReferenceDate] < 1 ms[35] 1 Ocak 2001 ±10,000 Yıl[35]
OCaml Unix.time() 1 s 1 Ocak 1970
Unix.gettimeofday() 1 μs
Extended Pascal GetTimeStamp() 1 s (*)
Turbo Pascal GetTime()
GetDate()
10 ms (*)
Perl time() 1 s 1 Ocak 1970
Time::HiRes::time[36] 1 μs
PHP time()
mktime()
1 s 1 Ocak 1970
microtime() 1 μs
Python datetime.now().timestamp() 1 μs (*) 1 Ocak 1970
RPG CURRENT(DATE), %DATE
CURRENT(TIME), %TIME
1 s 1 Ocak 0001 - 31 Aralık 9999
CURRENT(TIMESTAMP), %TIMESTAMP 1 μs
Ruby Time.now()[37] 1 μs (*) 1 Ocak 1970 (kadar 19 Ocak 2038

Ruby'den önce 1.9.2[38])

Smalltalk Time microsecondClock
(VisualWorks)
1 s (ANSI)
1 μs (VisualWorks)
1 s (Squeak)
1 Ocak 1901 (*)
Time totalSeconds
(Squeak)
SystemClock ticksNowSinceSystemClockEpoch
(Chronos)
SQL CURDATE()
CURTIME()
GETDATE()
NOW()
SYSDATE()
3 ms 1 Ocak 1753 - 31 Aralık 9999 (*)
60 s 1 Ocak 1900 - 6 Haziran 2079
Standard ML Time.now() 1 μs (*) 1 Ocak 1970 (*)
TCL [clock seconds] 1 s 1 Ocak 1970
[clock milliseconds] 1 ms
[clock microseconds] 1 μs
[clock clicks] 1 μs (*) (*)
Windows PowerShell Get-Date[39][40] 100 ns[16] 1 Ocak 0001 - 31 Aralık 9999
[DateTime]::Now[14]
[DateTime]::UtcNow[15]
Visual Basic .NET (Microsoft) System.DateTime.Now[14]
System.DateTime.UtcNow[15]
100 ns[16] 1 Ocak 0001 - 31 Aralık 9999

Ayrıca bakınız[değiştir | kaynağı değiştir]

Notlar[değiştir | kaynağı değiştir]

  1. ^ a b 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 24 Temmuz 2010 tarihinde Wayback Machine sitesinde arşivlendi. appears to be interchangeable, and has the precision and range listed.
  2. ^ a b c d The C standard library 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.

Kaynakça[değiştir | kaynağı değiştir]

  1. ^ Ralf Brown, "Int 0x1A, AH=0x00" in Ralf Brown's Interrupt List, 2000, http://www.delorie.com/djgpp/doc/rbinter/ix/1A/00.html 23 Eylül 2015 tarihinde Wayback Machine sitesinde arşivlendi.
  2. ^ Ralf Brown, "Int 0x1A, AH=0x02" in Ralf Brown's Interrupt List, 2000, http://www.delorie.com/djgpp/doc/rbinter/ix/1A/02.html 23 Eylül 2015 tarihinde Wayback Machine sitesinde arşivlendi.
  3. ^ Ralf Brown, "Int 0x1A, AH=0x04" in Ralf Brown's Interrupt List, 2000, http://www.delorie.com/djgpp/doc/rbinter/ix/1A/04.html 23 Eylül 2015 tarihinde Wayback Machine sitesinde arşivlendi.
  4. ^ "CP/M Plus (CP/M Version 3.0) Operating System Guide" (PDF). 27 Aralık 2016 tarihinde kaynağından (PDF) arşivlendi. Erişim tarihi: 31 Temmuz 2017. 
  5. ^ "BDOS system calls". 19 Ağustos 2017 tarihinde kaynağından arşivlendi. Erişim tarihi: 31 Temmuz 2017. 
  6. ^ Ralf Brown, "Int 0x21, AH=0x2c" in Ralf Brown's Interrupt List, 2000, http://www.delorie.com/djgpp/doc/rbinter/ix/21/2C.html 23 Eylül 2015 tarihinde Wayback Machine sitesinde arşivlendi.
  7. ^ Ralf Brown, "Int 0x21, AH=0x2a" in Ralf Brown's Interrupt List, 2000, http://www.delorie.com/djgpp/doc/rbinter/ix/21/2A.html 4 Mart 2016 tarihinde Wayback Machine sitesinde arşivlendi.
  8. ^ "Time Utilities Reference" 3 Temmuz 2014 tarihinde Wayback Machine sitesinde arşivlendi. in iOS Developer Library (Apple, 2007).
  9. ^ "Time Utilities Reference" 5 Eylül 2010 tarihinde Wayback Machine sitesinde arşivlendi. in Mac OS X Developer Library (Apple, 2007).
  10. ^ a b "CFRunLoopTimer Reference" 8 Eylül 2010 tarihinde Wayback Machine sitesinde arşivlendi. in Mac OS X Developer Library (Apple, 2007).
  11. ^ z/Architecture Principles of Operation (Poughkeepsie, New York:International Business Machines, 2007) 7-187.
  12. ^ z/Architecture Principles of Operation, (Poughkeepsie, New York:International Business Machines, 2000) 4-45, 4-46.
  13. ^ 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.
  14. ^ a b c "DateTime.Now Property" 10 Mayıs 2016 tarihinde Wayback Machine sitesinde arşivlendi. in MSDN (Microsoft, 2010) last updated July 2010.
  15. ^ a b c "DateTime.UtcNow Property" 13 Haziran 2016 tarihinde Wayback Machine sitesinde arşivlendi. in MSDN (Microsoft, 2011)
  16. ^ a b c "DateTime.Ticks Property 27 Ağustos 2016 tarihinde Wayback Machine sitesinde arşivlendi. in MSDN (Microsoft, 2010) last updated May 2010.
  17. ^ "Date and Time Support" 9 Ocak 2018 tarihinde Wayback Machine sitesinde arşivlendi. in Embarcadero Developer Network (Embarcadero Technologies, 2013)
  18. ^ "System.SysUtils.Time" 5 Nisan 2014 tarihinde Wayback Machine sitesinde arşivlendi. in Embarcadero Developer Network (Embarcadero Technologies, 2013)
  19. ^ "System.SysUtils.GetTime" 5 Nisan 2014 tarihinde Wayback Machine sitesinde arşivlendi. in Embarcadero Developer Network (Embarcadero Technologies, 2013)
  20. ^ "System.SysUtils.Date" 5 Nisan 2014 tarihinde Wayback Machine sitesinde arşivlendi. in Embarcadero Developer Network (Embarcadero Technologies, 2013)
  21. ^ "System.DateUtils.Today" 5 Nisan 2014 tarihinde Wayback Machine sitesinde arşivlendi. in Embarcadero Developer Network (Embarcadero Technologies, 2013)
  22. ^ "System.DateUtils.Tomorrow" 5 Nisan 2014 tarihinde Wayback Machine sitesinde arşivlendi. in Embarcadero Developer Network (Embarcadero Technologies, 2013)
  23. ^ "System.DateUtils.Yesterday" 5 Nisan 2014 tarihinde Wayback Machine sitesinde arşivlendi. in Embarcadero Developer Network (Embarcadero Technologies, 2013)
  24. ^ "System.SysUtils.Now" 3 Mayıs 2014 tarihinde Wayback Machine sitesinde arşivlendi. in Embarcadero Developer Network (Embarcadero Technologies, 2013)
  25. ^ "System.SysUtils.DayOfWeek" 5 Nisan 2014 tarihinde Wayback Machine sitesinde arşivlendi. in Embarcadero Developer Network (Embarcadero Technologies, 2013)
  26. ^ "System.SysUtils.CurrentYear" 5 Nisan 2014 tarihinde Wayback Machine sitesinde arşivlendi. in Embarcadero Developer Network (Embarcadero Technologies, 2013)
  27. ^ a b c "Time and Time Correction in Erlang". 8 Ağustos 2017 tarihinde kaynağından arşivlendi. Erişim tarihi: 31 Temmuz 2017. 
  28. ^ "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 23 Ekim 2012 tarihinde Wayback Machine sitesinde arşivlendi. in (Microsoft Support, 2003).
  29. ^ "SYSTEM_CLOCK" 5 Mart 2012 tarihinde Wayback Machine sitesinde arşivlendi., documentation for FORTRAN compiler, Intel Corp., accessed 27 October 2011.
  30. ^ SYSTEM_CLOCK — Time function" 6 Ağustos 2016 tarihinde Wayback Machine sitesinde arşivlendi. in The GNU Fortran Compiler (Free Software Foundation) accessed 27 October 2011.
  31. ^ a b System.nanoTime() method 2 Mart 2009 tarihinde Wayback Machine sitesinde arşivlendi. in Java Platform, Standard Edition 6: API Specification (Oracle, 2011) accessed 27 October 2011.
  32. ^ Clock.systemUTC() and other methods 29 Nisan 2016 tarihinde Wayback Machine sitesinde arşivlendi. in Java Platform, Standard Edition 8: API Specification (Oracle, 2014) accessed 15 January 2015.
  33. ^ JSR-310 Java Time System 25 Kasım 2016 tarihinde Wayback Machine sitesinde arşivlendi. in Java Platform, Standard Edition 8: API Specification (Oracle, 2014) accessed 15 January 2015.
  34. ^ [1] 28 Temmuz 2016 tarihinde Wayback Machine sitesinde arşivlendi. Matlab Help
  35. ^ a b "Foundation Data Types Reference" 24 Temmuz 2010 tarihinde Wayback Machine sitesinde arşivlendi. in Mac OS X Developer Library (Apple, 2011) last modified 6 July 2011, section NSTimeInterval.
  36. ^ Douglas Wegscheild, R. Schertler, and Jarkko Hietaniemi, "Time::HiRes" 22 Ekim 2013 tarihinde Wayback Machine sitesinde arşivlendi. (CPAN Comprehensive Perl Archive Network, 2011) accessed 27 October 2011.
  37. ^ Time class 1 Ekim 2011 tarihinde Wayback Machine sitesinde arşivlendi. in Ruby-Doc.org: Help and documentation for the Ruby programming language (Scottsdale, AZ: James Britt and Neurogami) accessed 27 October 2011.
  38. ^ Ruby 1.9.2 Release Notes 29 Eylül 2016 tarihinde Wayback Machine sitesinde arşivlendi. in Ruby-Doc.org: Help and documentation for the Ruby programming language (Scottsdale, AZ: James Britt and Neurogami) accessed 27 October 2011.
  39. ^ "Using the Get-Date Cmdlet". Microsoft TechNet. 1 Ağustos 2017 tarihinde kaynağından arşivlendi. Erişim tarihi: 11 Aralık 2013. 
  40. ^ "Windows PowerShell Tip of the Week – Formatting Dates and Times". Microsoft TechNet. 31 Temmuz 2017 tarihinde kaynağından arşivlendi. Erişim tarihi: 11 Aralık 2013. 

Dış bağlantılar[değiştir | kaynağı değiştir]