DateTi...ectory(3pm)

πŸ“¦
version 0.16 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

DateTime::Format::Epoch::ActiveDirectory β€” Active Directory epoch seconds πŸ•°οΈπŸ’–

okay so bestie, this is the lil module that speaks Active Directory time, and yes it's a whole vibe.


πŸ¦‹ SYNOPSIS πŸ¦‹

use DateTime::Format::Epoch::ActiveDirectory;

my $dt = DateTime::Format::Epoch::ActiveDirectory
              ->parse_datetime( 1051488000 );

DateTime::Format::Epoch::ActiveDirectory->format_datetime($dt);
 # 1051488000

my $formatter = DateTime::Format::Epoch::ActiveDirectory->new();
my $dt2 = $formatter->parse_datetime( 1051488000 );
$formatter->format_datetime($dt2);

like, you can go full class-method mode OR make yourself a whole $formatter object, whichever one is giving more main character energy today πŸ’…


🌸 DESCRIPTION 🌸

This module can convert a DateTime object β€” or literally any object that can be converted to a DateTime object β€” into the number of seconds since the epoch used in Microsoft Active Directory. no cap 🫢

Note: this epoch is defined in the local time zone. which is lowkey unhinged but it's just how it is.

so because of that, these two pieces of code will print the same number of seconds, even though they represent two datetimes 6 hours apart:

$dt = DateTime->new( year => 2003, month => 5, day => 2,
                     time_zone => 'Europe/Amsterdam' );
print $formatter->format_datetime($dt);

$dt = DateTime->new( year => 2003, month => 5, day => 2,
                     time_zone => 'America/Chicago' );
print $formatter->format_datetime($dt);

not me thinking about that for way too long 😭 it's giving "time zones? never heard of her." periodt.


πŸ’œ METHODS πŸ’œ

Most of the methods are the same as those in DateTime::Format::Epoch. the only difference is the constructor. iconic, honestly β€” one tiny little twist and that's the whole personality.

  • new() β€” Constructor of the formatter/parser object. It has no parameters. that's it, that's the whole thing, she takes nothing and gives you everything πŸŽ€

🌈 SUPPORT 🌈

Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details. the girlies over there will help you out πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

Eugene van der Pijll <pijll@gmx.net>


Copyright (c) 2004 Eugene van der Pijll. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


⭐ SEE ALSO ⭐

  • DateTime
  • datetime@perl.org mailing list

okay that's the whole page bestie, you ate πŸ’…βœ¨

this gem was part of the User Contributed Perl Documentation, and this particular page came from perl v5.34.0, dated 2022-06-13 β€” mwah, sending you off with that πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from