Wikibase::Datatype::Value::Time - Wikibase time value datatype.
use Wikibase::Datatype::Value::Time; my $obj = Wikibase::Datatype::Value::Time->new(%params); my $after = $obj->after; my $before = $obj->before; my $calendarmodel = $obj->calendarmodel; my $precision = $obj->precision; my $timezone = $obj->timezone; my $type = $obj->type; my $value = $obj->value;
This datatype is item class for representation of time.
new
my $obj = Wikibase::Datatype::Value::Time->new(%params);
Constructor.
Returns instance of object.
after
After. Default value is 0.
before
Before. Default value is 0.
calendarmodel
Calendar model. Default value is 'Q1985727' (proleptic Gregorian calendar).
precision
Time precision. Default value is 11.
timezone
Time zone. Default value is 0.
value
Time value. Parameter is required.
my $after = $obj->after;
Get after.
Returns number.
my $before = $obj->before;
Get before.
my $calendarmodel = $obj->calendarmodel;
Get calendar model. Unit is entity (e.g. /^Q\d+$/).
Returns string.
my $precision = $obj->precision;
Get precision.
my $timezone = $obj->timezone;
Get time zone.
type
my $type = $obj->type;
Get type. This is constant 'time'.
my $value = $obj->value;
Get value.
new(): From Wikibase::Datatype::Utils::check_entity(): Parameter 'calendarmodel' must begin with 'Q' and number after it. From Wikibase::Datatype::Value::new(): Parameter 'value' is required.
use strict; use warnings; use Wikibase::Datatype::Value::Time; # Object. my $obj = Wikibase::Datatype::Value::Time->new( 'precision' => 10, 'value' => '+2020-09-01T00:00:00Z', ); # Get calendar model. my $calendarmodel = $obj->calendarmodel; # Get precision. my $precision = $obj->precision; # Get type. my $type = $obj->type; # Get value. my $value = $obj->value; # Print out. print "Calendar model: $calendarmodel\n"; print "Precision: $precision\n"; print "Type: $type\n"; print "Value: $value\n"; # Output: # Calendar model: Q1985727 # Precision: 10 # Type: time # Value: +2020-09-01T00:00:00Z
Error::Pure, Mo, Wikibase::Datatype::Utils, Wikibase::Datatype::Value.
Wikibase datatypes.
https://github.com/michal-josef-spacek/Wikibase-Datatype
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2020-2022 Michal Josef Špaček
BSD 2-Clause License
0.20
To install Wikibase::Datatype, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wikibase::Datatype
CPAN shell
perl -MCPAN -e shell install Wikibase::Datatype
For more information on module installation, please visit the detailed CPAN module installation guide.