Posted On November 3, 2021

Convert LastLogon Date From Number to Date Time

kimconnect 0 comments
blog.KimConnect.com >> Codes >> Convert LastLogon Date From Number to Date Time

We have a case where our Admins have generated a CSV file with information about user accounts with associated LastLogon date value as a machine numerical value, rather than the human readable date value. A convenient way of expressing that value would be as follows:

1. Create a new column with this formula (tested to work with Excel and Google Spreadsheets):

=IF(G2>0,G2/(8.64*10^11)-109205,"")

2. Format the new column as ‘Date time’ as illustrated below.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

SQL: Use PowerShell to Validate if Database Exists

This function may be invoked remotely from a machine that has SQL-PS module installed. The…

ASCII Characters

DEC OCT HEX Symbol HTML Number Description 32 040 20     Space 33 041…

PowerShell: Grant Current User Full Access to File or Folder

# Grant Current User Full Access to Object $object='C:\temp' $acl=Get-Acl $object $currentUser=[System.Security.Principal.WindowsIdentity]::GetCurrent().Name $grantAccess=New-Object System.Security.AccessControl.FileSystemAccessRule("$currentUser","FullControl","Allow") $acl.AddAccessRule($grantAccess)…
Other project: DragonCoin.com