Solstice::DateTime - Models a point in time.
use Solstice::DateTime; my $dt = new Solstice::DateTime(time()); my $dt = new Solstice::DateTime('2005-03-11 02:34:12'); my $dt = new Solstice::DateTime('now'); # These functions return the object $date_time->addYears($year_count); $date_time->addMonths($month_count); $date_time->addDays($day_count);
No symbols exported.
Constructor. Returns a DateTime object.
Sets the date
Sets the time
Returns a duplicate DateTime object.
Add some number of years to the date.
Add some number of months to the date.
Add some number of days to the date
Add some number of hours to the date
Add some number of min to the date
Add some number of seconds to the date
Validate the date values as forming a valid date. Date::Calc::check_date does the heavy work.
Validate the time values as forming a valid time. Date::Calc::check_time does the heavy work.
Returns a boolean specifying whether the obj datetime is valid
Returns a boolean specifying whether the obj contains a datetime
Returns a boolean specifying whether the obj datetime is equal to the passed datetime.
Returns a boolean specifying whether the obj datetime is the same date to the passed in datetime
Returns a boolean specifying whether the obj datetime is before the passed datetime.
Returns a boolean specifying whether the obj datetime is before now.
Returns the number of days apart the 2 datetime objects are, as a float. Returns 0 if either is invalid.
Returns the number of seconds apart the 2 datetime objects are. Returns 0 if either is invalid.
Returns an SQL formatted date
Returns an ISO 8601 formatted date
Returns a human-readable date string
Return a formatted string, that displays a moving 3-day window
Returns a Unix formatted date (epoch seconds)
Returns a formatted datetime string; $format contains a strftime-style formatting string. Date validity is not implicit.
Takes a date object and compares it to itself.
Does the heavy lifting for addDays, addMonths, and addYears.
Update the date if the DateTime obj is a 'now' obj
Date::Format.
Catalyst Group, <catalyst@u.washington.edu>
$Revision: 3364 $
Copyright 1998-2007 Office of Learning Technologies, University of Washington
Licensed under the Educational Community License, Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.opensource.org/licenses/ecl1.php
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
To install Solstice, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Solstice
CPAN shell
perl -MCPAN -e shell install Solstice
For more information on module installation, please visit the detailed CPAN module installation guide.