Searched refs:dt (Results 1 - 25 of 781) sorted by relevance

1234567891011>>

/macosx-10.9.5/CPANInternal-140/DateTime/t/
H A D05set.t10 my $dt = DateTime->new( year => 1996, month => 11, day => 22,
15 is( $dt->month, 11, 'check month' );
17 $dt->set( month => 5 );
18 is( $dt->year, 1996, 'check year after setting month' );
19 is( $dt->month, 5, 'check month after setting it' );
20 is( $dt->day, 22, 'check day after setting month' );
21 is( $dt->hour, 18, 'check hour after setting month' );
22 is( $dt->minute, 30, 'check minute after setting month' );
23 is( $dt->second, 20, 'check second after setting month' );
25 $dt
[all...]
H A D01sanity.t10 my $dt = new DateTime( year => 1870, month => 10, day => 21,
15 is( $dt->year, '1870', "Year accessor, outside of the epoch" );
16 is( $dt->month, '10', "Month accessor, outside the epoch" );
17 is( $dt->day, '21', "Day accessor, outside the epoch" );
18 is( $dt->hour, '12', "Hour accessor, outside the epoch" );
19 is( $dt->minute, '10', "Minute accessor, outside the epoch" );
20 is( $dt->second, '45', "Second accessor, outside the epoch" );
21 is( $dt->nanosecond, '123456', "nanosecond accessor, outside the epoch" );
23 $dt = DateTime->from_object( object => $dt );
[all...]
H A D37local-add.t9 # These tests should be the final word on dt addition involving a
15 my $dt = DateTime->new( year => 2003, month => 4, day => 6,
19 $dt->add( hours => 1 );
20 is( $dt->datetime, '2003-04-06T01:00:00', 'add one hour to midnight, get 1 am' );
22 eval { $dt->add( hours => 1 ) };
24 is( $dt->datetime, '2003-04-06T03:00:00', 'add one hour to 1 am, get 3 am' );
26 $dt->subtract( hours => 1 );
27 is( $dt->datetime, '2003-04-06T01:00:00', 'subtract one hour from 3 am, get 1 am' );
29 $dt->subtract( hours => 1 );
30 is( $dt
[all...]
H A D31formatter.t25 my $dt = DateTime->from_epoch( epoch => time(), formatter => $formatter );
26 ok( $dt, "Constructor (from_epoch) : $@" );
28 $dt = eval { DateTime->new( year => 2004,
36 ok( $dt, "Construtor (new) : $@" );
38 $dt = eval{ DateTime->from_object( object => $dt, formatter => $formatter ) };
39 ok( $dt, "Constructor (from_object) : $@" );
41 is( $dt->formatter, $formatter, "check from_object copies formatter" );
43 is( $dt->_stringify(), '20040902 13:23:34', 'Format datetime' );
46 is( $dt
[all...]
H A D17set_return.t11 my $dt = DateTime->new( year => 2008, month => 2, day => 28 );
16 $p = $dt->set( year => 1882 );
17 is( DateTime->compare( $p, $dt ), 0, "set() returns self" );
19 $p = $dt->set_time_zone( 'Australia/Sydney' );
20 is( DateTime->compare( $p, $dt ), 0, "set_time_zone() returns self" );
22 $p = $dt->add_duration( $du );
23 is( DateTime->compare( $p, $dt ), 0, "add_duration() returns self" );
25 $p = $dt->add( years => 2 );
26 is( DateTime->compare( $p, $dt ), 0, "add() returns self" );
29 $p = $dt
[all...]
H A D28dow.t10 my $dt = DateTime->new( year => 0 );
12 is( $dt->year, 0, 'year is 0' );
13 is( $dt->month, 1, 'month is 1' );
14 is( $dt->day, 1, 'day is 1' );
15 is( $dt->day_of_week, 6, 'day of week is 6' );
19 my $dt = DateTime->new( year => 0, month => 12, day => 31 );
21 is( $dt->year, 0, 'year is 0' );
22 is( $dt->month, 12, 'month is 12' );
23 is( $dt->day, 31, 'day is 31' );
24 is( $dt
[all...]
H A D33seconds_offset.t10 my $dt = DateTime->new( year => 1997, month => 6, day => 30,
14 $dt->set_time_zone('+00:00:30');
16 is( $dt->datetime, '1997-06-30T23:59:29', '+00:00:30 leap second T-61' );
20 my $dt = DateTime->new( year => 1997, month => 6, day => 30,
24 $dt->set_time_zone('+00:00:30');
26 is( $dt->datetime, '1997-06-30T23:59:59', '+00:00:30 leap second T-31' );
32 my $dt = DateTime->new( year => 1997, month => 6, day => 30,
36 $dt->set_time_zone('+00:00:30');
38 is( $dt->datetime, '1997-06-30T23:59:60', '+00:00:30 leap second T-30' );
44 my $dt
[all...]
H A D34set_tz.t23 my $dt = DateTime->new( year => 1934, month => 2, day => 26,
27 $dt->set_time_zone( 'Africa/Niamey' );
29 is( $dt->year, 1934, 'local year should be 1934 (1934-02-25 23:59:59)' );
30 is( $dt->month, 2, 'local month should be 2 (1934-02-25 23:59:59)' );
31 is( $dt->day, 25, 'local day should be 25 (1934-02-25 23:59:59)' );
32 is( $dt->hour, 23, 'local hour should be 23 (1934-02-25 23:59:59)' );
33 is( $dt->minute, 59, 'local minute should be 59 (1934-02-25 23:59:59)' );
34 is( $dt->second, 59, 'local second should be 59 (1934-02-25 23:59:59)' );
36 is( $dt->is_dst, 0, 'is_dst should be 0 (1934-02-25 23:59:59)' );
37 is( $dt
[all...]
H A D25add_subtract.t12 my $dt = DateTime->new( year => 2000, month => 12 );
14 $dt->add( months => 1 )->truncate( to => 'month' )->subtract( seconds => 1 );
16 is( $dt->year, 2000, 'year is 2001' );
17 is( $dt->month, 12, 'month is 12' );
18 is( $dt->hour, 23, 'hour is 23' );
19 is( $dt->minute, 59, 'minute is 59' );
20 is( $dt->second, 59, 'second is 59' );
24 my $dt = DateTime->new( year => 2000, month => 12 );
25 my $dt2 = $dt->clone->add( months => 1 )->subtract( seconds => 1 );
H A D16truncate.t20 my $dt = DateTime->new(%vals);
21 $dt->truncate( to => 'second' );
24 is( $dt->$f(), $vals{$f}, "$f should be $vals{$f}" );
29 is( $dt->$f(), 0, "$f should be 0" );
34 my $dt = DateTime->new(%vals);
35 $dt->truncate( to => 'minute' );
38 is( $dt->$f(), $vals{$f}, "$f should be $vals{$f}" );
43 is( $dt->$f(), 0, "$f should be 0" );
48 my $dt = DateTime->new(%vals);
49 $dt
[all...]
H A D02last_day.t15 my $dt = DateTime->last_day_of_month( year => 2001,
20 is( $dt->year, 2001, 'check year' );
21 is( $dt->month, $month, 'check month' );
22 is( $dt->day, $last[ $month - 1 ], 'check day' );
27 my $dt = DateTime->last_day_of_month( year => 2004,
32 is( $dt->year, 2004, 'check year' );
33 is( $dt->month, $month, 'check month' );
34 is( $dt->day, $leap_last[ $month - 1 ], 'check day' );
H A D22from_doy.t19 my $dt = DateTime->from_day_of_year( year => 2001,
24 is( $dt->year, 2001, 'check year' );
25 is( $dt->month, $month, 'check month' );
26 is( $dt->day, 15, 'check day' );
27 is( $dt->day_of_year, $doy, 'check day of year' );
37 my $dt = DateTime->from_day_of_year( year => 2004,
42 is( $dt->year, 2004, 'check year' );
43 is( $dt->month, $month, 'check month' );
44 is( $dt->day, 15, 'check day' );
45 is( $dt
[all...]
/macosx-10.9.5/CPANInternal-140/DateTime-Format-ISO8601/t/
H A D02_examples.t25 my $dt = $iso8601->parse_datetime( '19850412' );
26 is( $dt->ymd, '1985-04-12' );
31 my $dt = $iso8601->parse_datetime( '1985-04-12' );
32 is( $dt->ymd, '1985-04-12' );
37 my $dt = $iso8601->parse_datetime( '1985-04' );
38 is( $dt->ymd, '1985-04-01' );
43 my $dt = $iso8601->parse_datetime( '1985' );
44 is( $dt->ymd, '1985-01-01' );
49 my $dt = $iso8601->parse_datetime( '19' );
50 is( $dt
[all...]
/macosx-10.9.5/CPANInternal-140/DateTime-Format-ISO8601-0.07/t/
H A D02_examples.t25 my $dt = $iso8601->parse_datetime( '19850412' );
26 is( $dt->ymd, '1985-04-12' );
31 my $dt = $iso8601->parse_datetime( '1985-04-12' );
32 is( $dt->ymd, '1985-04-12' );
37 my $dt = $iso8601->parse_datetime( '1985-04' );
38 is( $dt->ymd, '1985-04-01' );
43 my $dt = $iso8601->parse_datetime( '1985' );
44 is( $dt->ymd, '1985-01-01' );
49 my $dt = $iso8601->parse_datetime( '19' );
50 is( $dt
[all...]
/macosx-10.9.5/ksh-20/ksh/src/lib/libast/cdt/
H A Ddtclose.c29 int dtclose(reg Dt_t* dt) argument
31 int dtclose(dt)
32 reg Dt_t* dt;
38 if(!dt || dt->nview > 0 ) /* can't close if being viewed */
42 disc = dt->disc;
44 (ev = (*disc->eventf)(dt,DT_CLOSE,NIL(Void_t*),disc)) < 0)
47 if(dt->view) /* turn off viewing */
48 dtview(dt,NIL(Dt_t*));
51 { (void)(*(dt
[all...]
H A Ddtextract.c30 Dtlink_t* dtextract(reg Dt_t* dt) argument
32 Dtlink_t* dtextract(dt)
33 reg Dt_t* dt;
38 if(dt->data->type&(DT_OSET|DT_OBAG) )
39 list = dt->data->here;
40 else if(dt->data->type&(DT_SET|DT_BAG))
41 { list = dtflatten(dt);
42 for(ends = (s = dt->data->htab) + dt->data->ntab; s < ends; ++s)
45 else /*if(dt
[all...]
H A Ddtrestore.c32 int dtrestore(reg Dt_t* dt, reg Dtlink_t* list) argument
34 int dtrestore(dt, list)
35 reg Dt_t* dt;
41 reg Dtsearch_f searchf = dt->meth->searchf;
43 type = dt->data->type&DT_FLATTEN;
47 list = dt->data->here;
50 { if(dt->data->size != 0)
54 dt->data->type &= ~DT_FLATTEN;
56 if(dt->data->type&(DT_SET|DT_BAG))
57 { dt
[all...]
H A Ddtsize.c39 int dtsize(Dt_t* dt) argument
41 int dtsize(dt)
42 Dt_t* dt;
48 UNFLATTEN(dt);
50 if(dt->data->size < 0) /* !(dt->data->type&(DT_SET|DT_BAG)) */
51 { if(dt->data->type&(DT_OSET|DT_OBAG))
52 dt->data->size = treecount(dt->data->here);
53 else if(dt
[all...]
H A Ddtopen.c38 Dt_t* dt = (Dt_t*)Version; /* shut-up unuse warning */ local
46 if(!(dt = (Dt_t*) malloc(sizeof(Dt_t))))
50 dt->searchf = NIL(Dtsearch_f);
51 dt->meth = NIL(Dtmethod_t*);
52 dt->disc = NIL(Dtdisc_t*);
53 dtdisc(dt,disc,0);
54 dt->type = DT_MALLOC;
55 dt->nview = 0;
56 dt->view = dt
[all...]
H A Ddtmethod.c30 Dtmethod_t* dtmethod(Dt_t* dt, Dtmethod_t* meth) argument
32 Dtmethod_t* dtmethod(dt, meth)
33 Dt_t* dt;
38 reg Dtdisc_t* disc = dt->disc;
39 reg Dtmethod_t* oldmeth = dt->meth;
45 (*disc->eventf)(dt,DT_METH,(Void_t*)meth,disc) < 0)
48 dt->data->minp = 0;
51 list = dtflatten(dt);
53 if(dt->data->type&(DT_LIST|DT_STACK|DT_QUEUE) )
54 dt
[all...]
H A Ddtdisc.c25 ** dt : dictionary
32 static Void_t* dtmemory(Dt_t* dt,Void_t* addr,size_t size,Dtdisc_t* disc) argument
34 static Void_t* dtmemory(dt, addr, size, disc)
35 Dt_t* dt; /* dictionary */
52 Dtdisc_t* dtdisc(Dt_t* dt, Dtdisc_t* disc, int type) argument
54 Dtdisc_t* dtdisc(dt,disc,type)
55 Dt_t* dt;
65 if(!(old = dt->disc) ) /* initialization call from dtopen() */
66 { dt->disc = disc;
67 if(!(dt
[all...]
H A Ddtwalk.c31 int dtwalk(reg Dt_t* dt, int (*userf)(Dt_t*, Void_t*, Void_t*), Void_t* data) argument
33 int dtwalk(dt,userf,data)
34 reg Dt_t* dt;
43 for(obj = dtfirst(dt); obj; )
44 { if(!(walk = dt->walk) )
45 walk = dt;
46 next = dtnext(dt,obj);
/macosx-10.9.5/misc_cmds-32/ncal/
H A Deaster.c38 easterg(int y, date *dt) argument
49 dt->m = 3 + (l + 40) / 44;
50 dt->d = l + 28 - 31*(dt->m / 4);
51 dt->y = y;
52 return (dt);
57 easterog(int y, date *dt) argument
60 return (gdate(easterodn(y), dt));
65 easteroj(int y, date * dt) argument
68 return (jdate(easterodn(y), dt));
85 date dt; local
[all...]
/macosx-10.9.5/CPANInternal-140/DateTime-Format-W3CDTF-0.06/examples/
H A Dnow.pl7 my $dt = DateTime->now;
9 print $format->format_datetime($dt) . "\n";
/macosx-10.9.5/ruby-104/ruby/test/psych/
H A Dtest_date_time.rb7 dt = DateTime.now
8 yaml = Psych.dump dt
13 dt = DateTime.now
14 assert_cycle dt

Completed in 204 milliseconds

1234567891011>>