Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: aa7356 on April 03, 2020, 07:18:20 PM



Title: Bitcoin Solution as a Time Server
Post by: aa7356 on April 03, 2020, 07:18:20 PM
Hi all,

Sure at every computational system you need a clock. Bitcoin tick clock as widely published started at unix epoch time
block.nTime=1231006505

https://en.bitcoin.it/wiki/Genesis_block

My question is ..
I need to adapt a legacy system prior to unix epoch

is this script is ok? (I need a peer review)

Code:
#using Power$hell
+++++++++++++++++++++++++++++++++++++++++++++++++++++
$stopwatch = New-Object System.Diagnostics.Stopwatch
$stopwatch.Start()
$stopwatch.Stop()
$stopwatch

[Math]::Round((Get-Date).ToFileTimeUTC()/10000)

[Math]::Round((Get-Date).ToFileTime() / 10000000 - 11644473600)

<#
Where 11644473600 is the number of elapsed seconds between the
Microsoft epoch (January 1, 1601 A.D. (C.E.)) and the Unix epoch
(January 1, 1970, 12AM UTC/GMT)

https://msdn.microsoft.com/en-us/library/system.datetime.tofiletime(v=vs.110).aspx

=====> PowerShell Integrated Console <=====
#>