Python Forum
Convert ActiveDirectory timestamp into regular one. Arrow (solved)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert ActiveDirectory timestamp into regular one. Arrow (solved)
#1
Thumbs Up 
Hi everyone,

I try to convert the timestamp from active directory (accountExpires field)

132556896000000000 representing : 1/21/2021 12:00:00 AM Pacific Standard Time

Microsoft reference Wrote:This value represents the number of 100-nanosecond intervals since January 1, 1601 (UTC).

If possible, I would like to use arrow who work nice to work with dates/time

The simplest will be to convert the AD timestamp in "Arrow timestamp" first. But I don't know how is constructed the arrow timestamp :/ (I supposes unix time ? )
https://arrow.readthedocs.io/en/stable/

Any ideas ?
Reply
#2
Nevermind I found Big Grin

If somebody is interested, let me know and i'll post an explanation.
Reply
#3
Divide by 10000000, subtract 11644473600, and feed that in as a unix timestamp.

>>> arrow.get(132556896000000000/10000000 - 11644473600)
<Arrow [2021-01-21T08:00:00+00:00]>
SpongeB0B likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question [SOLVED] Correct way to convert file from cp-1252 to utf-8? Winfried 8 539 Feb-29-2024, 12:30 AM
Last Post: Winfried
  [SOLVED] Epoch timestamp without milliseconds? Winfried 5 2,840 Jan-27-2023, 04:35 PM
Last Post: deanhystad
Thumbs Up Convert an Interger into any base !? [Solved] SpongeB0B 8 1,357 Jan-16-2023, 10:24 AM
Last Post: SpongeB0B
  [SOLVED] Alternative to regex to extract date from whole timestamp? Winfried 6 1,774 Nov-16-2022, 01:49 PM
Last Post: carecavoador
  error in timestamp Led_Zeppelin 3 3,103 Jun-15-2022, 08:28 PM
Last Post: deanhystad
  error in timestamp Led_Zeppelin 0 978 Jun-10-2022, 07:59 PM
Last Post: Led_Zeppelin
  |SOLVED] Glob JPGs, read EXIF, update file timestamp? Winfried 5 2,410 Oct-21-2021, 03:29 AM
Last Post: buran
  Convert date integers (ex. 43831) to regular format Galven 2 2,552 Nov-15-2020, 11:38 PM
Last Post: bowlofred
  How to convert different timestamp formats? python_newbie09 12 6,731 Aug-05-2019, 06:37 PM
Last Post: python_newbie09
  Timestamp is undefined ErnestTBass 7 7,836 Feb-16-2019, 08:27 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020