# Time Stamp is one hour behind

**URL:** <https://forums.powershell.org/t/time-stamp-is-one-hour-behind/13301>\
**Category:** PowerShell Help\
**Created:** [October 21, 2019, 1:37pm UTC](https://forums.powershell.org/t/time-stamp-is-one-hour-behind/13301 "2019-10-21T13:37:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [October 21, 2019, 1:37pm UTC](https://forums.powershell.org/t/time-stamp-is-one-hour-behind/13301/1 "2019-10-21T13:37:27Z")

</div>

Hi All

I’m new to powershell so I’m finding my feet with it at the moment, I’m trying to capture when a users password expires amongst other things.

I have the following line of code however when returning “Passwordexpires” the time stamp is one hour behind, I have verified this by checking net user

[pre]Get-ADUser -Filter {Name -like $search} -Properties “Name”, “passwordlastset”, “Passwordneverexpires”, “passwordexpired”, “LockedOut”, “msDS-UserPasswordExpiryTimeComputed” | Sort-Object | Select Name, passwordlastset, @{Name=“Passwordexpires”;Expression={[datetime]::FromFileTime($\_.“msDS-UserPasswordExpiryTimeComputed”)}}, Passwordneverexpires, passwordexpired, LockedOut[/pre]

I have also tried using FromFileTimeUtc as well but the result is still the same?

Thanks in advance

Brad

---

<div class="post-metadata">

**Author:** ![kpatnayakuni](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/kpatnayakuni/32/19_2.png) [@kpatnayakuni](https://forums.powershell.org/u/kpatnayakuni)\
**Post date:** [October 21, 2019, 9:36pm UTC](https://forums.powershell.org/t/time-stamp-is-one-hour-behind/13301/2 "2019-10-21T21:36:26Z")

</div>

Hi there,

I didn’t see any issue here, I ran it in my test lab, and it workd fine. Please check your system datetime and timezone as well.

[pre]

\> Get-ADUser -Filter {Name -eq “Test User”} -Properties “Name”, “passwordlastset”, “Passwordneverexpires”, “passwordexpired”, “LockedOut”, “msDS-UserPasswordExpiryTimeComputed” | Select Name, passwordlastset, @{Name=“Passwordexpires”;Expression={[datetime]::FromFileTime($\_.“msDS-UserPasswordExpiryTimeComputed”)}}, Passwordneverexpires, passwordexpired, LockedOut

Name : Test User  
passwordlastset : 22-10-2019 08:31:36  
Passwordexpires : 03-12-2019 08:31:36  
Passwordneverexpires : False  
passwordexpired : False  
LockedOut : False

[/pre]

Thank you.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:31pm UTC](https://forums.powershell.org/t/time-stamp-is-one-hour-behind/13301/3 "2024-05-16T20:31:38Z")

</div>


