DateTime::Calendar::TauStation - Handle TauStation GCT datetimes
use DateTime::Calendar::TauStation; my $dt = DateTime::Calendar::TauStation->new( cycle => '001', day => '02', segment => '03', unit => '004', ); print $dt->gct_cycle; print $dt->gct_day; print $dt->gct_segment; print $dt->gct_unit;
Alternatively, combine with DateTime::Duration::TauStation and DateTime::Format::TauStation.
use DateTime::Calendar::TauStation; use DateTime::Format::TauStation; my $dur = DateTime::Format::TauStation->parse_duration( 'D/20:000 GCT' ); my $dt = DateTime::Calendar::TauStation->now->add_duration( $dur ); print DateTime::Format::TauStation->format_datetime($dt);
DateTime subclass for GCT (Galactic Coordinated Time) datetimes for the online game TauStation.
Accepts arguments:
Returns the datetime 000.00/00:000 GCT, a.k.a. 1964-01-22T00:00:27.689615 UTC.
000.00/00:000 GCT
1964-01-22T00:00:27.689615
Pre-catastrophe dates return a - sign.
-
Returns the cycle part of the datetime.
cycle
Returns the day part of the datetime.
day
Returns the segment part of the datetime.
segment
Returns the unit part of the datetime.
unit
Accepts the same arguments as "new", returns a signed integer.
Returns a DateTime::Duration::TauStation object.
Carl Franks
Based on code from https://github.com/zoffixznet/perl6-Games-TauStation-DateTime.
Copyright (c) 2018 Carl Franks.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
DateTime::Duration::TauStation, DateTime::Format::TauStation
To install DateTime::Calendar::TauStation, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DateTime::Calendar::TauStation
CPAN shell
perl -MCPAN -e shell install DateTime::Calendar::TauStation
For more information on module installation, please visit the detailed CPAN module installation guide.