.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "DBIx::Class::DateTime::Epoch 3pm" .TH DBIx::Class::DateTime::Epoch 3pm "2022-06-13" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" DBIx::Class::DateTime::Epoch \- Automatic inflation/deflation of epoch\-based columns to/from DateTime objects .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& package MySchema::Foo; \& \& use base qw( DBIx::Class ); \& \& _\|_PACKAGE_\|_\->load_components( qw( DateTime::Epoch TimeStamp Core ) ); \& _\|_PACKAGE_\|_\->add_columns( \& name => { \& data_type => \*(Aqvarchar\*(Aq, \& size => 10, \& }, \& bar => { # epoch stored as an int \& data_type => \*(Aqbigint\*(Aq, \& inflate_datetime => 1, \& }, \& baz => { # epoch stored as a string \& data_type => \*(Aqvarchar\*(Aq, \& size => 50, \& inflate_datetime => \*(Aqepoch\*(Aq, \& }, \& # working in conjunction with DBIx::Class::TimeStamp \& creation_time => { \& data_type => \*(Aqbigint\*(Aq, \& inflate_datetime => 1, \& set_on_create => 1, \& }, \& modification_time => { \& data_type => \*(Aqbigint\*(Aq, \& inflate_datetime => 1, \& set_on_create => 1, \& set_on_update => 1, \& } \& ); .Ve .SH "DATETIME::FORMAT DEPENDENCY" .IX Header "DATETIME::FORMAT DEPENDENCY" There have been no assumptions made as to what \s-1RDBMS\s0 you will be using. As per the note in the DBIx::Class::InflateColumn::DateTime documentation, you will need to install the DateTime::Format::* module that matches your \s-1RDBMS\s0 of choice. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module automatically inflates/deflates DateTime objects from/to epoch values for the specified columns. This module is essentially an extension to DBIx::Class::InflateColumn::DateTime so all of the settings, including \&\f(CW\*(C`locale\*(C'\fR and \f(CW\*(C`timezone\*(C'\fR, are also valid. .PP A column will be recognized as an epoch time given one of the following scenarios: .IP "\(bu" 4 \&\f(CW\*(C`data_type\*(C'\fR is an \f(CW\*(C`int\*(C'\fR of some sort and \f(CW\*(C`inflate_datetime\*(C'\fR is also set to a true value .IP "\(bu" 4 \&\f(CW\*(C`data_type\*(C'\fR is some other value (e.g. \f(CW\*(C`varchar\*(C'\fR) and \f(CW\*(C`inflate_datetime\*(C'\fR is explicitly set to \f(CW\*(C`epoch\*(C'\fR. .PP DBIx::Class::TimeStamp can also be used in conjunction with this module to support epoch-based columns that are automatically set on creation of a row and updated subsequent modifications. .SH "METHODS" .IX Header "METHODS" .SS "add_columns( )" .IX Subsection "add_columns( )" Provides backwards compatibility with the older DateTime::Epoch \s-1API.\s0 .SS "_inflate_to_datetime( )" .IX Subsection "_inflate_to_datetime( )" Overrides column inflation to use \f(CW\*(C`Datetime\->from_epoch\*(C'\fR. .SS "_deflate_from_datetime( )" .IX Subsection "_deflate_from_datetime( )" Overrides column deflation to call \f(CW\*(C`epoch()\*(C'\fR on the column value. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "\(bu" 4 DBIx::Class .IP "\(bu" 4 DBIx::Class::TimeStamp .IP "\(bu" 4 DateTime .SH "AUTHORS" .IX Header "AUTHORS" Brian Cassidy .PP Adam Paynter .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2006\-2012 by Brian Cassidy .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.