Show the epoch: Difference between revisions

no edit summary
No edit summary
Line 744:
{{out}}
<pre>Monday, January 01, 0001 12:00:00 AM</pre>
 
===Three Alternates===
<code>Get-Date</code> always returns its '''Kind''' property as Local:
<lang PowerShell>
Get-Date -Year 1 -Month 1 -Day 1 -Hour 0 -Minute 0 -Second 0 -Millisecond 0
</lang>
{{Out}}
<pre>
Monday, January 01, 0001 12:00:00 AM
</pre>
This approach returns its '''Kind''' property as Unspecified:
<lang PowerShell>
New-Object -TypeName System.DateTime
</lang>
{{Out}}
<pre>
Monday, January 01, 0001 12:00:00 AM
</pre>
Here you could describe the epoch date's '''Kind''' property as being Utc.
Formatting the output as a list for demonstration:
<lang PowerShell>
New-Object -TypeName System.DateTime -ArgumentList 1, 1, 1, 0, 0, 0, ([DateTimeKind]::Utc) | Format-List
</lang>
{{Out}}
<pre>
Date : 1/1/0001 12:00:00 AM
Day : 1
DayOfWeek : Monday
DayOfYear : 1
Hour : 0
Kind : Utc
Millisecond : 0
Minute : 0
Month : 1
Second : 0
Ticks : 0
TimeOfDay : 00:00:00
Year : 1
DateTime : Monday, January 01, 0001 12:00:00 AM
</pre>
 
=={{header|PureBasic}}==
308

edits