Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

LDAP Dates Converted

Posted on July 25, 2013October 26, 2015 By David Kittell

Dates that look like 127524839567199000 (pwdLastSet, accountExpires, lastLogonTimestamp, etc.)

IF(
	B16>0
	,B16/864000000000 - 109205
	,""
)

Example: 130186556607343750 converts to 40921.80861
40921.80861 in Excel with cell formatting of Date/Time will show as January 13th, 2012 7:24 PM

Dates that look like 20050210223453.0Z (whenChanged)

DATEVALUE(
	CONCATENATE(
		(LEFT(TRIM(B9),4))
		,"-"
		,(RIGHT(LEFT(TRIM(B9),6),2))
		,"-"
		,RIGHT(LEFT(TRIM(B9),8),2)
	)
)
+
TimeValue(
	CONCATENATE(
		RIGHT(LEFT(TRIM(B9),10),2)
		,":"
		,RIGHT(LEFT(TRIM(B9),12),2)
		,":"
		,RIGHT(LEFT(TRIM(B9),14),2)
	)
)

Example: 20080523192311.0Z in Excel with cell formatting of Date/Time will show as 7/18/2013 9:14 PM

Source: http://maxvit.net/convert_ldap_dates

Originally Posted on July 25, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code LDAP

Post navigation

Previous post
Next post

Related Posts

PowerShell – Change Windows CD/DVD Drive Letter

Posted on May 14, 2018

# Set CD/DVD Drive to A: $cd = $NULL $cd = Get-WMIObject -Class Win32_CDROMDrive -ComputerName $env:COMPUTERNAME -ErrorAction Stop if ($cd.Drive -eq "D:") { Write-Output "Changing CD Drive letter from D: to A:" Set-WmiInstance -InputObject ( Get-WmiObject -Class Win32_volume -Filter "DriveLetter = ‘d:’" ) -Arguments @{DriveLetter=’a:’} } # Set CD/DVD Drive…

Read More

Ubuntu / Raspberry Pi – Install NGINX Load Balance DNS

Posted on February 20, 2018

sudo apt install nginx Replace the IP addresses with your IP addresses sudo cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf-original sudo sed -i "/^\s*#/d;s/\s*#[^\"’]*$//" /etc/nginx/nginx.conf && sudo sed -i ‘/^\s*$/d’ /etc/nginx/nginx.conf Modify your config file to look like this user www-data; worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; events { worker_connections 768; } http {…

Read More

Zorin OS – Remove Preloaded Applications

Posted on November 3, 2017

Depending on your purpose this script may be helpful as it will remove a lot of the preloaded applications. CAUTION: This list of applications should be reviewed first. My intention of this removal script is to remove a lot of applications that a business or kid computer may not need….

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories
  • Raspberry Pi - Remove Default Apps
  • PowerShell - Change Windows CD/DVD Drive Letter
©2025 David Kittell | WordPress Theme by SuperbThemes