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

PowerShell: Renaming a System File

System files are typically owned by the TrustedInstaller account and protected from deletion or changes.…

PowerShell: Obtaining SQL Database Default Paths

# This function returns an array of 3 string values reflecting default Data, Log, and…

PowerShell: Disable Microsoft Dynamics CRM Organization

# disableCrmOrganization.ps1 $orgname='testOrg' $domain='kimconnect.com' $dnsServer='10.10.10.10' $credentials=@{ 'kimconnect\crmAdmin'='password'; 'kimconnect\devAdmin'='password'; } $usernamePrefix='kimconnect\crm' $servernameSuffix='-app01' $ipDictionary=@{ 'dev01'='1.1.1.1'; 'prod01'='2.2.2.2'; }…